[Mono-devel-list] Memory management for long running processes (desc-heap profiler)

Alex Chudnovsky alexc at majestic12.co.uk
Tue Mar 29 14:55:44 EST 2005


Ben Maurer wrote:

>It gives you an output of the largest stuff. Where did you get the 100+ mb from?
>  
>
Thats what I was trying to find out ;) Well, application DOES take fair 
amount of memory, on Windows too,
however it seems to use much more on Linux. Say on Windows typical 
memory usage is about 50-60, however
on Linux it appears to be 100Mb Virt memory and 50-60 of non-share 
memory + a few megs of shared RAM.

Here is copy paste from top command:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
23502 alex      17   0  2148  936  724 R  0.7  0.2   0:00.18 top
 8794 alex      15   0  9400 2168 1748 S  0.0  0.6   0:01.47 sshd: 
alex at pts/6
 8795 alex      15   0  6116 1380 1136 S  0.0  0.4   0:00.29 -bash
23365 alex      16   0  9400 2128 1748 S  0.0  0.6   0:00.28 sshd: 
alex at pts/8
23366 alex      16   0  6180 1380 1144 S  0.0  0.4   0:00.09 -bash
23447 alex      15   0 78908  47m 5840 T  0.0 12.7   0:06.66 mono 
MJ12nodeMono.exe /s /q

Stats for the box are:

Mem:    386044k total,   331280k used,    54764k free,    11856k buffers
Swap:   786232k total,    55116k used,   731116k free,   138612k cached

While on topic, and I think I mentioned that, I don't understand why 
Environment.WorkingSet is correct
on Windows port of Mono but seems to be set to 0 on Linux?!?! Should I 
submit it as a bug?

Can memory be used by SQLite that I think consumes memory in unmanaged 
fashion unseen by GC?

>Can you try running with GC_PRINT_STATS=yes mono foo.exe?
>  
>
I just did run it (nice trick) and it printed the following (taken from 
end):

--------------------------------------------------------------------------------------
Initiating full world-stop collection 36 after 21849912 allocd bytes
--> Marking for collection 36 after 21849912 allocd bytes + 558888 
wasted bytes
Collection 35 finished ---> heapsize = 45903872 bytes
World-stopped marking took 60 msecs
Complete collection took 80 msecs
Initiating full world-stop collection 37 after 14422584 allocd bytes
--> Marking for collection 37 after 14422584 allocd bytes + 232952 
wasted bytes
Collection 36 finished ---> heapsize = 45903872 bytes
World-stopped marking took 60 msecs
Complete collection took 70 msecs
--------------------------------------------------------------------------------------

Is this an indication that high memory usage happens outside of managed 
by GC memory?

If thats the case then what's the best way to identify the leak then?

cheers

Alex



More information about the Mono-devel-list mailing list