I'm using the 4.0 trial version on a .NET 4 WPF application.
* start a profiling session
* attach to process (using Debugging Tools, since selecting Profling API just crashes my app)
** why would my app crash with the Profiling API selection?
* at this point I get a warning "The memory leak investigation guide requirews at least limited instance tracking"
** what does this mean? I selected "collect instance data" in the previous dialog
* take a couple of snapshots
* close my application
At this point the session starts closing automatically and I get prompted to save my session. While saving I then get "Session cannot be saved (or something). Cannot access a closed file." From that point on I can no longer use the session that was in progress (attempting to use the snapshots gives me more "closed file" errors. If I try to open the session that was saved on disk I get "invalid session file". So my profiling session is lost.
Is this a known issue?
Attaching using the Profiling API is more intrusive than the Debugging Tools attach, since the profiler will be loaded into the profiled process. This will cause some additional memory overhead in the profiled process, and if the process is very close to run out of memory this can cause an out of memory error, which can cause your process to crash. Is your process close to run out of memory when you try to attach the profiler?
For the memory leak guide to work, it needs to be able to identify instances between snapshots. When using Debugging Tools attach, the profiler will not know how an instance is moved in memory between snapshots and thus instances cannot be identified between two snapshots. "Collect instance data" means that you collect additional field values for each instance (in addition to just the references between instances), it is not related to instance tracking.
I have not seen the error "Cannot access a closed file" before. Maybe this is indirectly caused by the session file size limitation in .NET Memory Profiler 4.0. Did you get any other error messages before the "closed file" message? Would it be possible for you to send us the log-file from the profiler so that we can investigate this further? It's named ProfilerClientLog.txt and you can find the log-file in the folder "C:\Users\Andreas\AppData\Local\SciTech\MemProfiler4\Logs".
SciTech Software AB
The bug was caused by the fact that the profiler failed to collect a snapshot from the profiled process (the second snapshot in your session). When attaching to a process using the Debugging Tools, there's unfortunately a risk that the snapshot is collected while the garbage collector is moving instances in memory. If this happens, the snapshot collection will fail to collect data about the managed instances.
We have fixed the bug that caused the "closed file" error. We have not yet released the fix officially, but it is included in the latest build (v4.0.126), which you can download from http://memprofiler.com/MemProfilerInstaller4_0_126.exe.
To avoid the problem with failed snapshots, we recommend that you use "Profiling API" attach instead, if possible. But apparantly, this is not working well for you either. This is something we would also like to investigate further. To get more information about this problem, would it be possible for you to send us more detailed log files? To create the log-files you need to use the standalone profiler and supply the "/log:<path>" command line argument, e.g. by using the following Run command:
"C:\Program Files\SciTech\NetMemProfiler4\NetMemProfiler.exe" /log:c\MemProfilerLogs
When you try to attach to the process again, this will create a set of log-files in the c:\MemProfilerLogs folder. If you send the log-files to firstname.lastname@example.org, we will take a look at them as soon as possible.
SciTech Software AB
Users browsing this forum: Google [Bot] and 13 guests