How track Large Object Heap allocations (memory fragmentation)?


The biggest need we are having in debugging .Net memory usage for Realmware's Visual3D, is eliminating Out Of Memory exceptions. We know the root cause: arrays that are large enough to end up on the Large Object Heap (LOH), leading to memory fragmentation. In other words, even though these arrays are freed properly, .Net has a shockingly poor algorithm for LOH allocation -- apparently little or no attempt to re-use virtual memory holes, until the entire 2 GB application virtual memory space has been touched, by which time all that is left are relatively small holes, too small for the very large arrays needed for textures and other huge objects during 3D authoring. We have been gradually locating LOH usage, and moving such logic to processes outside the main application process, to avoid this memory fragmentation.

Our need:

Locate all allocations on LOH.  Or approximating that, locate all allocations larger than 85000 bytes (even if they are properly freed).

Any feature in dotTrace that would help with this?


Please sign in to leave a comment.