Exporting stats when application closes

Hi,
I was chasing a leak occuring during appliction setup with MemInsight . Leak was in routines executed from mainform create.
I placed tms.MI.MainForm.TTMSMIMainForm.GetInstance.cbActive.Checked := true; to start of .dpr
and it seemed to collect data ok.
Now I would like to save data (callstacks mostly) from all classes in question before application closes, is that possible?

Hello Mika,

yes, this is possible. Within your code include the unit TMS.MI.Access
You can either log the data to a file using
MemoryProfiler.SaveToFile('x:\test.xml');
or set it up using
MemoryProfiler.LogToFile := True;
MemoryProfiler.LogFileName := 'x:\test2.xml';
so everything will be logged to a file if the MemoryProfiler closes.

Just as an addition: you don't need to show and use the UI as it is being done in your code.
MemoryProfiler.Active := True;
will also start tracing, but no UI will be shown.

I hope this answers your question,
Kind Regards
Stefan

1 Like

Yes, this was what i was looking for. Could't find that from developers guide.
Thanks.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.