[Mono-list] Profiling web app to find where memory is going

Joshua Tauberer tauberer at for.net
Sun Jan 8 21:36:58 EST 2006

Christopher Bergström wrote:
> Can you give the 30 second version of how to hook this up to my web 
> app?  I'm going to guess just put runprof in my path and change that out 
> for mono and  add a syslog entry it looks like?  If you have any patches 
> for the multithreading please attach or email to me.. Great work!

Yeah.  Attached is my modified version of profx.c.  A diff would be 
about the same size.  It takes care of the threading issue (using the 
pthreads version of a thread local variable -- hopefully that's the 
right way to do it), the output is changed a bit, and it writes out a 
report to /tmp/profile.txt every 15 seconds (if there have been 

The report includes the types accounting for at least 5% of the memory 
allocated (not counting anything deallocated), and the methods 
accounting for at least 5% of the allocations of each type.

To build, run make as before.  Put libmono-profiler-x.so and runprof 
(revised attached) in your website directory, and then run runprof. 
Besides the 15 second reports, the report is printed to stdout when xsp 
ends gracefully.

I'll get it committed somewhere eventually.

- Joshua Tauberer


** Nothing Unreal Exists **

-------------- next part --------------
A non-text attachment was scrubbed...
Name: profx.c
Type: text/x-csrc
Size: 9860 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20060108/07c60413/profx.bin
-------------- next part --------------

DIR=`dirname $0`
mono --profile=x /usr/lib/xsp/1.0/xsp.exe "$@"

More information about the Mono-list mailing list