[Mono-list] howto debug cpu leak from commandline?

Christopher David Howie me at chrishowie.com
Tue May 11 13:39:26 EDT 2010


On 05/11/2010 03:37 AM, Esben Laursen wrote:
> I have a program that collects some syslog information and analyzes
> that. My problem is that suddenly it consumes all cpu cores 100% This
> happens from time to time sometime after 10 minutes some after
> 12hours. My problem is that I develop in VS2008 and run the software
> primarily on Linux using mono. I have not yet seen it fail in
> Windows, but that might just be a coincidence.
> 
> So is there any way I can debug this on the Linux system, I have used
> dotTrace in Windows and that was great, is there a similar tool for
> mono?

I have not used dotTrace, but I know that the mono runtime has a --trace
option that might be useful.  Note that it will spew a LOT of output, so
you might want to run it like so:

mono --trace --debug yourapp.exe 2>&1 | bzip2 > yourapp.log.bz2

Note that this will show no output on the console; it will all go into
the log file, together with the trace output.

Then when the application hangs, kill the mono process so that bzip2 can
clean up.  Then to view the log:

bzip2 -d -c yourapp.log.bz2 | less

Hit "end" and poke around to see what it was up to when you killed it.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

PGP key:

pub   2048R/CF8338F5 2010-04-14
      Fingerprint: 2B7A B280 8B12 21CC 260A  DF65 6FCE 505A CF83 38F5


More information about the Mono-list mailing list