Memory Profiling in a CI workflow - Virtual Machines

Use this forum to discuss subjects that don't belong in the other forums.
Post Reply
rochar
Posts: 1
Joined: Fri Apr 09, 2021 10:06 am

Memory Profiling in a CI workflow - Virtual Machines

Post by rochar » Fri Apr 09, 2021 10:29 am

Hi,

I'm developing / prototyping a solution to test memory leaks in a WPF Application,

Using .Net Memory Profile Api and 'SciTech.NetMemProfiler.Core.dll' in a Continuous Integration workflow.

This is done by launching a Virtual Machine, Running the application and attaching to the process:

int processId = process.Id; // Id of process

ProfilerApplicationCore application = new ProfilerApplicationCore();
ProfileProcessStartInfo profileProcessStartInfo = new ProfileProcessStartInfo(ProfilingType.Attach, "test.exe");
profileProcessStartInfo.ProcessId = processId;

profileProcessStartInfo.AttachType = AttachType.NoAPI;
profileProcessStartInfo.UseDumpFile = true;

// Create session
using (ActiveSession activeSession = application.CreateSession(profileProcessStartInfo))
{
// Start it
activeSession.Start(TimeSpan.FromMinutes(5));
// Collect a snapshot
activeSession.CollectSnapshot(SnapshotCollection.None);
activeSession.Stop();


This is working in the developing machine with .Net Memory Profiler Installed.

I have two questions regarding this solution:

1. How can I have this running in a Virtual Machine without installing every time the .NEt Memory Profile Application? A nuget packge would be awesome!
2. Regarding the license, I just need a license, Standard Edition, per Virtual Machine?

Thanks
Ricardo

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

Re: Memory Profiling in a CI workflow - Virtual Machines

Post by Andreas Suurkuusk » Fri Apr 09, 2021 4:17 pm

Hi,
  1. The internal .NET Memory Profiler API, the NmpCore task, and the NmpDataCollector are available as NuGet packages (SciTech.MemProfilerApi, SciTech.NmpCore.Task, SciTech.NmpDataCollector), but then snapshots can only be collected from within the profiled process. The external API, that allows you to start profiling and collect snapshots from an external process is not available as a NuGet package. If you are not able to keep the VM image between runs, you will unfortunately need to install .NET Memory Profiler each time.
  2. The internal APIs and related Nuget packages don't require a license. However, using the external 'SciTech.NetMemProfiler.Core.dll' API requires a Professional edition license. Note that .NET Memory Profiler is licensed per named user, so you don't need a license per virtual machine. Instead each user managing the VMs requires a license.
For version 6.0 we plan to redesign the internal and external API so that they are both available as license free NuGet packages. The 'SciTech.NetMemProfiler.Core.dll' API is actually the API used by the profiler itself. The new API will be more aimed at automated memory testing. However, version 6.0 is a major upgrade, and it will be a while before it's released.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests