Memory Fragmentation Testing Tools

Recently I read topics about memory fragmentation: How to solve the problem of memory fragmentation and What is memory fragmentation?

I want to see a memory allocation map, such as the author in this article http://pavlovdotnet.wordpress.com/2007/11/10/memory-fragmentation/

Could you advise some tools to get such a memory allocation map so that I can see if the memory is fragmented and what is the largest free space.

I am on Windows, so I would prefer tools that work on this system.

+6
source share
2 answers

Here is a tool that visualizes GC memory and heap usage, and source code is also provided. Another similar application is also related to comments.

If you need to be able to profile memory usage for a .NET solution, you can check the ANTI Memory Profiler , it can run along with a project in Visual Studio and monitor how processes and objects use memory.

+4
source

There is an indirect solution to the problem. I have been developing a server application for several years. Initially, we perform on-demand distribution, and as a result, after several weeks of operation, server performance deteriorates. As a workaround, we followed this approach -

Suppose you have custom classes X, Y, Z, .. that you need to allocate from the heap at runtime. Highlight n number of X objects at startup. Put all these objects in the list of free pools. Upon request, take each x object and submit it to your application. When you use, put it in the list of downloaded pools. When the application wants to release it, return it back to the list of free pools. Follow this start for Y. Z, etc.

Since you select all the necessary objects at startup and never release them back into the OS memory box until your program exits, you will not experience performance degradation caused by memory fragmentation.

+2
source

Source: https://habr.com/ru/post/917105/


All Articles