Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with CLRProfiler

I am trying to use Microsoft's CLRProfiler to profile my fairly large app, and it is crashing whenever it tries to write (or read) a log file. Ironically, the exact bug is documented on the MS 'Feedback' site as being not reproducible, and seems never to have been fixed. I am getting a NullReferenceException at:

CLRProfiler.ReadNewLog.ReadFile(Int64 startFileOffset, Int64 endFileOffset, ReadLogResult readLogResult)
at CLRProfiler.MainForm.checkProcessTimer_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Does anyone have any ideas how I could go about either getting help or, ideally getting the damn thing to run properly? Plaintive calls for help on MSDN have been ignored... Thanks!

like image 806
Joel in Gö Avatar asked Oct 27 '25 03:10

Joel in Gö


2 Answers

The CLR Profiler is quite unstable, I also experienced many crashes with it.

One hint that I have heard at PDC is to use it only as a snapshot tool: don't collect the mem usage information during the run of the application, but stop the app at a point where you know you have the mem problem already, and make a mem snapshot.

This way it is much more stable, and usually from the reference graph you anyway can find out what causes the leak.

like image 145
Gaspar Nagy Avatar answered Oct 30 '25 14:10

Gaspar Nagy


I suspect that is a dead avenue. Perhaps try jetBrains dotTRACE; you can get a free 10 day trial to see if it is suitable.

like image 27
Marc Gravell Avatar answered Oct 30 '25 16:10

Marc Gravell