Hi, is it possible to list all objects stored in heap. I would like to do something like this:
IEnumerable<GCHandle> listOfObjectsInHeap = GetListOfObjectsFromHeap();
Hi, is it possible to list all objects stored in heap. I would like to do something like this:
IEnumerable<GCHandle> listOfObjectsInHeap = GetListOfObjectsFromHeap();
I am not aware of any managed function that allows you to do this. You could retrieve this information using the HeapWalk function. Here's an example of using it (it creates a new heap but you could retrieve the current process heap with GetProcessHeap).
You can use the Profiling API to achieve this. Unfortunately not in managed code.