[Mono-devel-list] Memory management for long running processes

Alex Chudnovsky alexc at majestic12.co.uk
Mon Mar 28 15:19:58 EST 2005


Thanks for quick response Ben. I was indeed using --profile command that 
generated nice list of calls to functions + memory usage. Am I correct 
thinking that default behavior of --profile would be to give combined 
data on memory usage during whole of runtime rather than max live usage? 
Come to think of that it would be strange for this tool to work 
otherwise as it gives only one snapshot which should contain combined 
totals. Therefore my conclusions over GC not willing to release memory 
based on profiler's output might not be correct.

Memory leaking issue however does appear to be present as app leaked 
memory so much that it locked up Linux box :-/

Your help would be much appreciated, you can get application here:

http://www.majestic12.co.uk/files/mj12node/mono/mj12node_mono_0987.tgz

Main executable is MJ12nodeMono.exe, once you run it you should see menu 
and you will need to start webserver (press S) and then use your browser 
to displayed webserver's address to configure a few parameters before 
software starts working. You will need to go to Options screen and 
register (only few details needed) and after you do this the node will 
start working and it leaks memory on at least one Linux box. It 
transpired that switching away from Mono.Data.SqliteClient to ADO.NET 
from SourceForge helped plug leaks, however it was still leaking.

I am currently engaged in discussion with people who try to run port of 
the app to Linux here http://www.majestic12.co.uk/forum/viewforum.php?f=6
if you have any questions on how to setup software or any details about 
configs then please just post there -- thread about Linux's port is the 
longest we ever had :)

While we are on the subject I noticed that I was not able to determine 
amount of memory used by my process from the process itself using the 
following code that works fine on Windows but not on Linux:

        // returns memory used in MegaBytes
        public static int GetMemoryUsage()
        {
            return 
System.Diagnostics.Process.GetCurrentProcess().WorkingSet/(1024*1024);
        }

cheers,

Alex

-- 
regards,

Alex Chudnovsky
Majestic-12: Distributed Search Engine
http://www.majestic12.co.uk




More information about the Mono-devel-list mailing list