in reply to Prevent "Out of Memory" error

... a simple hack which i would try, is to run a thread that monitors top or ps for your pid, then internally throttle back your main app by sleeping for some microseconds, or some put delay in the node creation loop

... see linux memory leak monitor for a Tk memory monitor, from which you can extract the memory code..... which reads it right from /proc.... it's just a hack, because it won't adjust for varying system loads, but maybe you could parse outputs of mem, and top, then use some internal logic to introduce more microsecond delays in the main thread....you may even discover a new algorithm which you could sell to google..

...call it Gyro...... a dynamic top :-) .... a differential equation between mem and system load


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku