[Mono-list] Garbage collection and memory usage

Georgi Moskov g.moskov at gmail.com
Fri Apr 7 04:00:24 EDT 2006

Hi Miguel,

I am experiencing the same problem with my web application and the
root ot the problem seems to be in the mono process that runs
mod-mono-server. The curious thing is that it seems to hang every time
when it consumes around 50% from the system memory. Here are some
traces, I hope they help a little:


Tasks:  66 total,   2 running,  64 sleeping,   0 stopped,   0 zombie
Cpu(s):  4.3% us,  3.7% sy,  0.0% ni, 91.7% id,  0.0% wa,  0.0% hi,  0.3% si
Mem:    190940k total,   185772k used,     5168k free,     3080k buffers
Swap:    72252k total,    35984k used,    36268k free,    38264k cached

16019 www-data  15   0  124m  93m 8876 S  6.6 50.3   8:17.75 mono


0xb7c706c6 in semop () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7c706c6 in semop () from /lib/tls/libc.so.6
#1  0xb7ecfbb7 in _wapi_shm_sem_lock () from /usr/lib/libmono.so.0
#2  0xb7ec5567 in _wapi_handle_count_signalled_handles ()
   from /usr/lib/libmono.so.0
#3  0xb7ed3ca6 in SignalObjectAndWait () from /usr/lib/libmono.so.0
#4  0xb7ed3ed2 in WaitForMultipleObjectsEx () from /usr/lib/libmono.so.0
#5  0xb7e86b3b in mono_install_thread_callbacks () from
#6  0xb7e86e8a in mono_thread_manage () from /usr/lib/libmono.so.0
#7  0xb7e0c0da in mono_main () from /usr/lib/libmono.so.0
#8  0x0804857b in ?? ()
#9  0x00000005 in ?? ()
#10 0xbfc84ec4 in ?? ()
#11 0xbfc84e98 in ?? ()
#12 0xb7bac974 in __libc_start_main () from /lib/tls/libc.so.6
#13 0xb7bac974 in __libc_start_main () from /lib/tls/libc.so.6


# strace -p 16019
Process 16019 attached - interrupt to quit
semop(3538953, 0xbfc84b90, 1

Mono version is
mod_mono version is 1.1.13

Georgi Moskov

On 4/7/06, Miguel de Icaza <miguel at ximian.com> wrote:
> Hello,
> > Assuming this is the case, what on earth can I do to troubleshoot this?
> >  Is there something we can do in code to help the GC? I thought the
> >  whole point of languages like C# was to get /away/ from awful days of
> >  malloc + free'ing memory like in C :(
> Thanks for posting the message, we need a few more data points here.
> You mention that the application will go down within twenty minutes.  By
> the time it goes down, what is growing out of proportion?   Is it the
> Apache process with mod_mono or is it the Mono process that runs
> mod-mono-server.exe?
> You mentioned that requests were being received, but they were not
> getting a reply.  What was the size of Mono then?
> Am curious in this particular case if this is a case of Mono leaking
> memory or if this is a case of Mono running out of threads to process
> responses.
> Your initial description sounds like Mono is hanging, not that Mono is
> leaking.
> This could be caused by a number of reasons: the requests might not be
> completing;   You might be using some library that has a threadpool
> leak;  You might be starving and deadlocking the threadpool internally.
> Miguel.
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

More information about the Mono-list mailing list