I'm trying to investigate memory use of a large multi-threaded server. According to mallinfo(), I get arena=350M
and fordblks=290M
, which suggests most of the space is actually wasted inside malloc()
. The malloc_info()
function gives a nice XML data structure that is supposed to be self-explanatory. Still, can someone explain to me
0
special? Is the that main arena in which all others reside?<size from=.../>
chunk allocated, free/available or both?<system>
element? Memory allocated using mmap()/sbrk()
?<aspace>
element? Available memory?<aspace type="mprotect" .../>
?Just for a start, I'd like to be able to plot total memory allocated by the application, i.e., everything allocated and not yet freed, according to what malloc()
thinks.
A large amount of virtual memory usage is not necessarily a problem. The default malloc implementation will allocate large amounts of storage per thread in order to avoid contention issues. This happens particularly on 64-bit implementations which are pretty common nowadays. You should not worry unless you experience problems with the size of resident memory or you get paging problems.
Kevin Grigorenko has written a number of blog posts which deal with memory usage in relation to WebSphere, but they are applicable to any large multi-threaded process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With