GNU malloc_info (): get really allocated memory?

I am trying to research the memory usage of a large multithreaded server. According to mallinfo (), I get arena=350M and fordblks=290M , which means that most of the space is actually lost inside malloc() . The malloc_info() function provides a good XML data structure, which is supposed to be self explanatory. However, can someone explain to me

  • Is heap 0 special? Is this the main arena in which everyone else lives?
  • Are the selected fragments <size from=.../> free / available, or both?
  • What is a <system> element? Memory allocated with mmap()/sbrk() ?
  • What is an <aspace> element? Available memory?
  • What about <aspace type="mprotect" .../> ?

Just for starters, I would like to be able to display the shared memory allocated by the application, i.e. everything selected and not yet freed, according to what malloc() thinks.

+6
source share
1 answer

A large amount of virtual memory usage is not necessarily a problem. The default malloc implementation will allocate large amounts of storage per thread to avoid conflicts. This happens, in particular, in 64-bit implementations, which are quite common these days. You should not worry if you do not have problems with the size of resident memory or there are problems with a search call.

Kevin Grigorenko wrote a few blog posts that relate to memory usage in relation to WebSphere, but they apply to any large threaded multi-process.

+1
source

All Articles