Failed to save session file - Operation is not valid due to the current state of the object

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
fusilliDivarication
Posts: 1
Joined: Wed Feb 27, 2019 8:05 pm

Failed to save session file - Operation is not valid due to the current state of the object

Post by fusilliDivarication » Wed Feb 27, 2019 8:40 pm

I ran a profiler session overnight with snapshots every two hours. That seems to have worked fine, and I can perform some analysis in the still-open session, however, I don't want to lose these results (in general, but especially in case of a crash, power failure, forced Windows Update reboot, etc). I attempted to 'Save' and 'Save as'; both return an error:
.NET Memory Profiler wrote:Failed to save session file.
Operation is not valid due to the current state of the object.
I did run NMP with the -log option; ProfilerClientLog.txt has this line corresponding with attempts to save the session, but it's not clear if that's just a side-effect of UI/control flow changes:

Code: Select all

-SciTech.NetMemProfiler.RealTime.Presenters.RealTimeSummaryPresenter|Item with id 2c30432f-f724-4755-a616-6a3c931edbce and key FinalizedInstances is not available.
I see that GUID a number of around the beginning of a session in the ProfilerClientLog with additional log entries like '[...] key TotalInstances is not available', '[...] key Gen0GCs is not available', and shortly thereafter with an accompanying stack trace:

Code: Select all

2019-02-26 17:00:24.6151|1|INFO|-SciTech.NetMemProfiler.RealTime.Presenters.RealTimeSummaryPresenter|Item with id 2c30432f-f724-4755-a612-6a3c931edbce and key FinalizedInstances is not available.
2019-02-26 17:00:25.6375|18|INFO|SciTech.Profiler.ProfiledProcess|Assembly already added, reinitializing
2019-02-26 17:00:26.0985|1|INFO|-SciTech.NetMemProfiler.RealTime.Presenters.RealTimeSummaryPresenter|Item with id 2c30432f-f724-4755-a612-6a3c931edbce and key FinalizedInstances is not available.
2019-02-26 17:00:26.1268|1|ERROR|SciTech.NetMemProfiler.ProfilerApplicationImpl|HandleUnexpectedException
System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at SciTech.Profiler.RealTime.Series.Memory.TypeSummaryGcSeriesProvider.CreateDataSeries(RealTimePlotType plotType, ExpandedBuffersCollection`3 expandedBuffers, Boolean connect)
   at SciTech.Profiler.RealTime.Series.Memory.RealTimeGcSeriesProvider`2.CreateDataSeries(RealTimePlotType plotType, Boolean connect)
   at SciTech.Profiler.RealTime.Series.Memory.ManagedStatisticsSeriesFactory.CreateSeries(RealTimeProcessSource processSource, String seriesKey, Boolean isDiscrete)
   at SciTech.Profiler.RealTime.Series.Memory.ManagedStatisticsSeriesFactory.CreateSeries(RealTimeSource realTimeSource, String seriesKey, Boolean isDiscrete)
   at SciTech.Profiler.RealTime.ViewModels.RealTimeSeriesViewModel.UpdateFromSettings(IReadOnlyList`1 sources, RealTimePresentationSeriesFactory presentationSeriesFactory, RealTimeSeriesUpdater seriesUpdater, Boolean useEndTime, Boolean showRecent)
   at SciTech.Profiler.RealTime.Presenters.RealTimeSummaryPresenter.UpdateSeries()
   at SciTech.Profiler.RealTime.Presenters.RealTimeSummaryPresenter.PerformScheduledUpdates()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
I also attempted deselecting all but two of the snapshots when attempting to 'Save as' and had the same result.

I also attempted deselecting the option for 'Include instance data' (which have values like 2,479,212 or 2,487,332) and got the same result.

I'm using .NET Memory Profiler 5.6.46.0 on a clean and fully updated installation of Windows Server 2008 R2 Standard.

Is there any other way I can try to save this session before I lose it? Let me know if you'd like me to post other log excerpts or send the full logs somewhere (~1.1 MB compressed without ProfilerLog.txt, or ~9.3 MB with it).

Thanks!

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

Re: Failed to save session file - Operation is not valid due to the current state of the object

Post by Andreas Suurkuusk » Fri Mar 01, 2019 3:12 pm

The "Item ... is not available" message is just an informational message and should not affect anything. The "Operation is not valid due to the current state of the object" error is a bug that we have fixed in the upcoming maintenance release of .NET Memory Profiler. It's a bit surprising that it occurs when saving a session, so if you wish you can send us the log-files so that we can investigate them. We're mainly interested in the "ProfilerClientLog.txt" file, so you can probably just e-mail it to us at support@scitech.se.

The maintenance release will be released in the beginning of the next week, but you can download it now from http://memprofilerwe.blob.core.windows. ... 5_6_49.exe.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests