Many GC'd language implementations don't give memory back to the OS if the
size of the heap decreases. This is not necessarily a big problem, because
pages that are not actively used will be paged out if other processes need
that memory. However it can make the the OS's memory usage statistics difficult to interpret.

It seems that you're using Windows. In Task Manager, choose 'Select columns...' in the View menu, and tick 'VM Size'. Run your program until it has allocated
a lot of memory and then GC'd it. Then try running another memory-intensive
program, and see whether the resulting memory pressure causes some of the
memory reserved by ozengine.exe to be paged out -- if this is the case, you
should see that the 'Mem Usage' field for ozengine.exe decreases while the
'VM Size' field stays high.

(If 'Mem Usage' stays high, then so much for this theory; you probably have
a real memory leak.)

When the solver runs out of memory, the system starts swapping so heavily that it is quite hard to kill ozengine (so much for the test :-)). If the engine indeed does not give free'd memory pages back to the OS, then this could be the problem, but I doubt that this is the case (other tests run fine).

I was thinking about Task Manager being inaccurate about the real memory usage of the emulator. After a heavy-load (say 600MB) iteration, when the heap usage drops back to what it was, say 13MB, it seems that the memory usage is not 25 MB as it was before, but say 50 MB (and in time, this tends to get much worse, at the same heap size level). I thought that system (either Mozart or OS) does this to prevent re-allocating memory frequently, because it is very likely that a program that needed 600MB just a second ago will need to allocate something in the near future. But when the heap increases (decreases) by say 10 kB, I can immediately see this as a memory usage increase (decrease) in the Task Manager (or PView, if you are a VC++ fan :-)), so it seems that everything of the 50MB system RAM is really in use. This is what confuses me - I can keep the heap size low, but not the memory usage of the emulator :-(

I can be wrong, of course, maybe I'm missing something... I'll try to implement persistence (using pickled values), so I can restart ozengine during the search and see if the memory requirements differ.

Thanks for any ideas,
Filip
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to