Page 1 of 1

mem profiler hangs analyzing compared snapshots

Posted: Thu Jan 15, 2015 7:19 pm
by JohnL4

I'm trying to run the mem profiler on our app (a pretty big multi-app-domain, mixed winforms/wpf C++/ monster), and the profiler is hanging after my first snapshot. The status bar at the bottom of the window says "Analysing compared snapshots... (Trivial duplicate instances at depth 1: 1,196,628 duplicates found, 429,821 possible duplicates left.)"

The memprofiler process is occupying 25% of my CPU (4 CPU machine, so I'm guessing some thread has gone into a loop). I have noticed that if I let it sit for about 25 minutes, it does finish, but then I get a hang when I take the 2nd snapshot and after about 25 minutes and sometimes the profiler crashes. (A 25-minute wait between snapshots obviously makes this tool unworkable for me.)

Any ideas?

OS is Win 7 Enterprise SP 1.


Re: mem profiler hangs analyzing compared snapshots

Posted: Fri Jan 16, 2015 4:43 pm
by Andreas Suurkuusk
The duplicate instances analysis is performed in the background and should not prevent you from working with the snapshot, or collecting additional snapshots. Is the profiler window completely stuck during the analysis?

Duplicate instances detection can take quite long time, but trivial duplicates should normally be investigated much faster. In your case, the duplicates analysis is probably finished (for trivial duplicates at depth 1), and the found duplicates are being added to the analysis information. This should normally not take too long time, but if there are many sets of duplicates (e.g. if each set only consists of two instances), there can be a performance issue. This is something we will try to improve in a future release.

Are you running the profiler as a 32-bit or 64-bit process? If you are running as a 32-bit process, i.e. on a 32-bit OS or within Visual Studio, then the crash can be caused by an out-of-memory error, due to too many duplicate instances set (and a large snapshot).

To avoid this problem you can try to disable the automatic duplicate analysis by selecting "Profiler->Auto-detect duplicates->None", before collecting the snapshot. I hope this helps.

Re: mem profiler hangs analyzing compared snapshots

Posted: Fri Jan 16, 2015 5:49 pm
by JohnL4
Thanks, helpful answer.

Profiler UI remains responsive during analysis of first snapshot. However, it becomes completely frozen immediately upon attempting to collect the 2nd snapshot.

Profiler is being run standalone on a 64-bit OS. I'm going to assume that means it's the 64-bit version. (Also, in task manager, NetMemProfiler.exe does NOT have a "*32" next to it (as other entries do), so I'll assume that means it's 64-bit.)

Auto duplicate detection off works around the problem.

I assume there's no log file I can send y'all, or you'd have already mentioned it.


Re: mem profiler hangs analyzing compared snapshots

Posted: Mon Jan 19, 2015 7:51 am
by Andreas Suurkuusk
Thanks for the update. Yes, as soon as you run the standalone profiler on a 64-bit OS, it will run as 64-bit process.

I looked at the code where the duplicate instances issues are being added, and it appears that this task it not automatically cancelled when a new snapshot is requested. That's why the second snapshot freezes the UI, since it waits for the analysis to finish or be cancelled. This issue will be fixed in the next release.

A log-file named ProfilerLog.txt is stored in the folder "C:\Users\<user name>\AppData\Local\SciTech\MemProfiler4\Logs". If the profiler crashes or shows an error message, this log-file can include useful information. If you get a crash, it would be good if you sent the log-file to us.