Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Nov 2016 12:12:09 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Matthias Andree <matthias.andree@gmx.de>
Cc:        freebsd-hackers@FreeBSD.org,  Mark Linimon <linimon@lonesome.com>
Subject:   Re: sbrk(0) replacement for memory resource tracking?
Message-ID:  <86oa1dujna.fsf@desk.des.no>
In-Reply-To: <dd964b1d-db3c-94d4-794b-929b28326430@gmx.de> (Matthias Andree's message of "Thu, 10 Nov 2016 22:21:18 %2B0100")
References:  <20161110012624.GA23701@lonesome.com> <dd964b1d-db3c-94d4-794b-929b28326430@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthias Andree <matthias.andree@gmx.de> writes:
> OTOH, e2fsprogs uses only sbrk(0) to track its overall memory use, and
> only to track its resource usage.  I'll be happy to help porting to
> something else that serves the same purpose, aka "how much memory am I
> using" - but what would that be?

Ideally, the realization that the numbers you get from sbrk() are
completely meaningless, followed by removal of that code.

And I don't just mean that they're meaningless because jemalloc() uses
mmap() - they were meaningless before jemalloc(), because they only tell
you how much address space the program has allocated, not how much of it
is actually in use.  And even if it did, it wouldn't tell you anything
about memory pressure, how much of the program's memory is swapped out,
etc.  It's like asking how long a road is and then claiming to know
where you are based on that answer.  You don't - all you know is how far
you could have gone without a break if you'd started at one end and kept
going.  And for all you know, there may be a section that's closed for
repairs.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86oa1dujna.fsf>