Memory usage: jemalloc v/s libc allocator
Jason Evans
jasone at canonware.com
Tue Mar 3 10:07:03 PST 2015
It appears that you're measuring all privately mapped virtual memory, but what you really want to measure is physical memory usage. jemalloc typically maps at least two 4 MiB chunks of virtual memory early during startup, but most of that memory is initially untouched, and therefore not a significant resource utilization issue. Look at "resident" memory usage (RSS column reported by the top utility) instead of virtual memory usage.
Thanks,
Jason
> On Mar 3, 2015, at 9:21 AM, Eduardo Silva <edsiper at gmail.com> wrote:
>
> Initially I used gnome-system-monitor, then I did it with ps_mem.py
> script which can be found here:
>
> https://raw.githubusercontent.com/pixelb/ps_mem/master/ps_mem.py
>
> the results are:
>
> 1) System malloc:
>
> $ python ps_mem.py -p 22545
> Private + Shared = RAM used Program
>
> 2.5 MiB + 41.0 KiB = 2.5 MiB monkey
> ---------------------------------
> 2.5 MiB
>
> 2) with Jemalloc:
>
> $ python ps_mem.py -p 26105
> Private + Shared = RAM used Program
>
> 14.6 MiB + 42.5 KiB = 14.6 MiB monkey
> ---------------------------------
> 14.6 MiB
>
> note: the server is not receiving any request.
>
> thanks
>
>
> On Tue, Mar 3, 2015 at 10:49 AM, Daniel Micay <danielmicay at gmail.com> wrote:
>> On 03/03/15 09:38 AM, Eduardo Silva wrote:
>>> Hi,
>>>
>>> I got some reports about high memory usage by our open source project
>>> when jemalloc is enabled, to put you in context: Monkey HTTP Server[0]
>>> by default uses jemalloc in static linking mode, but optionally at
>>> build time can use the common system allocator.
>>>
>>> When starting the server with jemalloc, the server uses an average of
>>> 8MB, when is disabled (common system allocator) it goes down to 174KB.
>>> This is a major concern when used on Embedded environments so I would
>>> like to know how can we reduce the space used by jemalloc initially.
>>>
>>> If required I can provide steps to reproduce the scenario.
>>>
>>> [0] http://monkey-project.com
>>>
>>> thanks for your time,
>>
>> How are you measuring memory usage?
>>
>>
>> _______________________________________________
>> jemalloc-discuss mailing list
>> jemalloc-discuss at canonware.com
>> http://www.canonware.com/mailman/listinfo/jemalloc-discuss
>>
>
>
>
> --
> Eduardo Silva
> http://edsiper.linuxchile.cl
> http://monkey-project.com
> _______________________________________________
> jemalloc-discuss mailing list
> jemalloc-discuss at canonware.com
> http://www.canonware.com/mailman/listinfo/jemalloc-discuss
>
More information about the jemalloc-discuss
mailing list