interpretation of malloc_stats_print() output

Jason Evans jasone at canonware.com
Tue Jun 2 22:10:23 PDT 2015


On Jun 2, 2015, at 11:25 AM, Mayank Kumar (mayankum) <mayankum at cisco.com <mailto:mayankum at cisco.com>> wrote:
> I am trying to match output from malloc_stats with output from top and also trying to figure out total process virtual memory usage from stats.
>  
> What fields in the stats should be added to get the total virtual memory for my process ?

For the version of jemalloc you're using, virtual memory can be computed by multiplying the number of chunks times the chunk size -- 396 MiB in this case.

> Also is this link an accurate measurement of fragmentation for my process?
> http://jemalloc.net/mailman/jemalloc-discuss/2014-April/000766.html <http://jemalloc.net/mailman/jemalloc-discuss/2014-April/000766.html>
>  
> from the link it seems active should be less than allocated, but I see otherwise. Is there a documentation somewhere to decipher this interesting output from jemalloc stats ?

The jemalloc manual documents all the statistics:

	http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html <http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html>


> CPUs: 2
> Arenas: 8
> Pointer size: 4
> Quantum size: 16
> Page size: 4096
> Min active:dirty page ratio per arena: 8:1
> Maximum thread-cached size class: 32768
> Chunk size: >>>4194304<<< (2^22)
> Allocated: 251363184, active: 270594048, mapped: 415236096
> Current active ceiling: 1488977920
> chunks: nchunks   highchunks    curchunks
>             100           99           >>>99<<<
> huge: nmalloc      ndalloc    allocated
>             0            0            0
>  [...]

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jemalloc.net/mailman/jemalloc-discuss/attachments/20150602/b20249c8/attachment.html>


More information about the jemalloc-discuss mailing list