Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jul 2016 09:02:23 -0700
From:      Conrad Meyer <cem@freebsd.org>
To:        RW <rwmaillists@googlemail.com>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Why kinfo_getvmmap is sometimes so expensive?
Message-ID:  <CAG6CVpXQE=ox4D4WB1Z%2BAhV79QzStiVfFwm0V3_qOB2N5-KzzA@mail.gmail.com>
In-Reply-To: <20160708130258.7b772558@gumby.homeunix.com>
References:  <e6dc27c0-0454-0666-b3e1-887bd116a847@rawbw.com> <20160707001913.GJ38613@kib.kiev.ua> <6193bbf3-39cd-abaa-a5e4-0480c40dac55@rawbw.com> <20160708130258.7b772558@gumby.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 8, 2016 at 5:02 AM, RW via freebsd-hackers
<freebsd-hackers@freebsd.org> wrote:
> On Thu, 7 Jul 2016 15:32:28 -0700
> Yuri wrote:
>
>> When people raise the question of why malloc library doesn't unmap
>> the memory, developers there usually say that they call
>> madvise(MADV_FREE) and this is as good as unmap.
>
> It's better than unmapping because freed memory is commonly re-malloced
> shortly after it's freed.
>
>> But this example
>> shows that this isn't quite the case on the FreeBSD, and unmapping is
>> better.
>
> That doesn't mean it's better in general.

Additionally, it would not be difficult to make
"getProcessSizeBytes()" cheaper without changing malloc.  Fetching the
entire VM map from the kernel when you only care about an integer RSS
count is obviously inefficient.

Best,
Conrad



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpXQE=ox4D4WB1Z%2BAhV79QzStiVfFwm0V3_qOB2N5-KzzA>