sbrk(0) replacement for memory resource tracking?
Conrad Meyer
cem at freebsd.org
Wed Nov 16 02:27:10 UTC 2016
On Thu, Nov 10, 2016 at 2:26 PM, Matthias Andree <matthias.andree at gmx.de> wrote:
> OK. So the quick and dirty way to re-enable e2fsprogs on those
> architectures whilst scrapping any memory statistics would be to #define
> sbrk(a) (a) which would just invalidate stats, providing the application
> handles bogus data.
>
> Other than that, it would seem that mallctl("epoch", ...) to synch up
> stats, and mallctl("stats.active", ...) or perhaps or "stats.mapped"
> gets me close to what comparing sbrk(0) over process lifetime would have
> achieved, wouldn't it? This is assuming sbrk() had page granularity
> anyhow and stats.active provides exactly that (gross memory allocated).
> Possibly this also wants mallctlnametomib and mallctlbymib for
> optimization if called often. Right?
Yes, something exactly like that (jemalloc-specific) or perhaps
libprocstat (FreeBSD-specific).
Best,
Conrad
More information about the freebsd-hackers
mailing list