I just noticed that, in fact, the "magic number" (20 in the example) seems to depend on the speed of the CPU, and the CPU usage. On my desktop computer (1.4 GHz), it crashes around 9-10, and on my laptop (2.6 GHz), it crashes around 12-13.
The memory usage doesn't jump here... Just 2 Mb increase.