Collecting snapshots while application is paused

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Terry
Posts: 4
Joined: Thu Oct 05, 2006 5:37 am

Collecting snapshots while application is paused

Post by Terry » Fri Oct 06, 2006 2:08 am

Hi there,

I am using v3 of the memory profiler, and I have also attached vs2005 as a debugger. What I want to do is break at a certain time, and collect a snapshot. However, the profiler seems to just sit there saying "collecting snapshot". Is this allowable? Has it hung or is it just taking ages? Does anyone know a reason why taking a snapshot when paused is a bad idea?

Cheers,
TERRY

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Fri Oct 06, 2006 1:19 pm

It is possible to attach a debugger to the profiled process and perform normal debugging, but you cannot collect a heap snapshot while pausing the process in the debugger (e.g. stopping on a breakpoint). Collecting a heap snapshot causes a lot of code to be executed in the profiled process. If this code cannot execute, the snapshot collection will never finish.

If you need to collect a snapshot while pausing in the debugger, you should be able to use the attach to feature in v3.0. No code is executed in the profiled process when collecting a heap snapshot on an attached process.

Note that in .NET Framework 1.x, it is not possible to attach a debugger while profiling. If you try that, you risk getting a dead-lock in the debugger or the profiled process.

I would also recommend
Best regards,

Andreas Suurkuusk
SciTech Software AB

Terry
Posts: 4
Joined: Thu Oct 05, 2006 5:37 am

Post by Terry » Mon Oct 09, 2006 11:59 pm

Thank you for the reply - attaching the profiler to the debugging process worked fine.

At the end of your post you said "I would also recommend" - what were you going to say after that?

Cheers,
TERRY

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Thu Oct 12, 2006 8:52 pm

The "I would also recommend" text was included by mistake, it should have been deleted.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests