keeping memory usage at certain limit

Salvatore Sanfilippo antirez at gmail.com
Tue Apr 29 05:36:17 PDT 2014


Hello,

Redis files zmalloc.[ch] contain an implementation of a jemalloc
wrapper that can track the size of the currently allocated memory, as
the sum of all the individual allocations, plus functions to get the
ratio between the actual resident set size of the process and this
sum, in order to obtain the fragmentation level. This is used as a
base to implement Redis "maxmemory" directive that looks similar to
what you want.

Source code (BSD licensed) here:

https://github.com/antirez/redis/blob/unstable/src/zmalloc.c
https://github.com/antirez/redis/blob/unstable/src/zmalloc.h

Regards,
Salvatore

On Tue, Apr 29, 2014 at 2:29 PM, Antony Dovgal <antony.dovgal at gmail.com> wrote:
> On 04/29/2014 03:28 PM, Bradley C. Kuszmaul wrote:
>>
>> Are transparent huge pages enabled? Does disabling them help?  (If so, you
>> may be able to thus workaround, and perhaps jemalloc could be improved.)
>
>
> From what I can see, they are disabled:
>
> $ cat /sys/kernel/mm/transparent_hugepage/enabled
> always madvise [never]
>
> --
> Wbr,
> Antony Dovgal
>
>
> _______________________________________________
> jemalloc-discuss mailing list
> jemalloc-discuss at canonware.com
> http://www.canonware.com/mailman/listinfo/jemalloc-discuss



-- 
Salvatore 'antirez' Sanfilippo
open source developer - GoPivotal
http://invece.org

To "attack a straw man" is to create the illusion of having refuted a
proposition by replacing it with a superficially similar yet
unequivalent proposition (the "straw man"), and to refute it
       — Wikipedia (Straw man page)


More information about the jemalloc-discuss mailing list