More aggressive page purging

Mike Hommey mh+jemalloc at glandium.org
Thu May 10 11:46:14 PDT 2012


On Thu, May 10, 2012 at 11:19:07AM -0700, Jason Evans wrote:
> I don't see the point in double purge on OS X (or FreeBSD, which
> behaves similarly), assuming that the kernel actually does the right
> think under memory pressure.  All it does is make 'top' output easier
> to interpret,  yet jemalloc provides adequate statistics to accurately
> assess the application's actual active memory footprint (and Firefox
> even exposes those statistics, right?).  IMO MADV_FREE is a feature,
> not a bug.  Indeed, on Linux, MADV_DONTNEED is a performance headache
> that we've had to work around in various ways at Facebook, with mixed
> success.
> 
> My memory of Windows virtual memory semantics is fuzzy, but my
> recollection is that the decommit support we put into jemalloc for
> Firefox was motivated primarily by inadequate operating system
> statistics for Windows XP that confused our understanding of actual
> memory usage.  The VirtualAlloc() documentation indicates that
> MEM_RESET has the same semantics as MADV_FREE, which is (again IMO) a
> good thing.

It has the same semantics, which is why I'm suggesting both could use
the same thing.

> In summary, I don't think there's a problem here to fix.  Am I missing
> something?

We could use RSS - number of madvised pages, for sure, but that doesn't
quite help with people looking at their task manager ans seeing memory
usage 1GB higher than what it actually is. (And it doesn't help to make
the numbers Firefox itself reports believable)

Mike



More information about the jemalloc-discuss mailing list