Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting memory fragmentation problem in a process

What are the various mechanisms using which we can detect if a process execution is leading to memory fragmentation?

Are there any tools available for the same? Suggestion for tools which work with 'C' code and can run on Windows, Linux and VxWorks will be helpful.

like image 326
Jay Avatar asked Jan 22 '10 06:01

Jay


People also ask

How is memory fragmentation measured?

You can measure fragmentation directly by looking at /proc/buddyinfo which will tell you how many free chunks are available on each zone of each NUMA node per each order. You can do a little math and calculate what percentage of free memory is available for allocations of a certain order.

How is the problem of memory fragmentation handled?

Reducing the number of sizes between these extremes also helps. Employing sizes that increase logarithmically saves a lot of fragmentation. For example, each size could be 20% larger than the previous size. “One size fits all” might not be true for memory allocators in embedded system.

What is memory fragmentation How can this issue be solved?

This problem occurs when you allocate RAM to processes continuously. It is done in paging and segmentation, where memory is allocated to processes non-contiguously. As a result, if you remove this condition, external fragmentation may be decreased. Compaction is another method for removing external fragmentation.

Why is memory fragmentation a problem?

Fragmentation is more likely to be a problem when your application makes a series of allocations and deallocations such that each time an allocation is made it cannot re-use space that was left by a previous deallocation of a similar (or larger) size block.


1 Answers

Just as a suggestion, you may want to try Valgrind. I'm not certain it's what you're looking for, but it may come in handy.

http://valgrind.org/

like image 162
Dean Pucsek Avatar answered Oct 12 '22 06:10

Dean Pucsek