In dotMemory it is possible to list all types that are contained in an object set.
In dotMemory Unit, the ObjectSet class provides getters for 'ObjectsCount' and 'SizeInBytes', but (as far as I know!?) it is not possible to get a list of all types that are contained in an object set.
var firstSnapshot = dotMemory.Check();
var newObjects = memory.GetDifference(firstSnapshot).GetNewObjects();
var subSet = newObjects.GetObjects(x => x.Namespace.Like("MyNamespace.*"));
Console.WriteLine("Number of objects: " + subSet.ObjectsCount);
Console.WriteLine("Size in bytes: " + subSet.SizeInBytes);
var subSetObjectsList = subSet.ToList()); //not available
Is there any possibility to get all types of objects that are contained in a set? If not, might there be a method in future versions?
Such a method would be great for some automated tests, for example:
1. make first snapshot
2. call some function
3. make another snapshot and save list of new objects since first snapshot (type, size in bytes and number of objects)
4. do n times:
4a. call function
4b. make snapshot and save list of new objects since last snapshot (type, size in bytes and number of objects)
5. for all types in the lists, do some checks on collected data (e.g.: is number of objects of any type growing faster than linear?)
6. if a check fails, save .dmw file with all snapshots