Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Aug 2012 14:24:18 +0300
From:      Aleksandr Rybalko <ray@dlink.ua>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Aleksandr Rybalko <ray@freebsd.org>, freebsd-embedded@freebsd.org, jasone@freebsd.org
Subject:   Re: jemalloc vs old allocator
Message-ID:  <20120801142418.f56aa606.ray@dlink.ua>
In-Reply-To: <201207301422.10029.jhb@freebsd.org>
References:  <20120726143551.b2b0ce30.ray@freebsd.org> <CAJ-Vmo=NApROEYSBL_A1HFci3WTPgDAmjajnXRJeOBpSWpNtsA@mail.gmail.com> <20120730113418.97694fdf.ray@freebsd.org> <201207301422.10029.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 30 Jul 2012 14:22:09 -0400
John Baldwin <jhb@freebsd.org> wrote:

>> On Monday, July 30, 2012 4:34:18 am Aleksandr Rybalko wrote:
>> > On Fri, 27 Jul 2012 10:04:27 -0700
>> > Adrian Chadd <adrian@freebsd.org> wrote:
>> > 
>> > >> Just as a note, ray@ compared jemalloc-HEAD with an older
>> > >> jemalloc.
>> > >> 
>> > >> I've just asked him to compare it to phkmalloc from -8. He'll
>> > >> hopefully post those results soon.
>> > >> 
>> > >> Still, great work. :)
>> > >> 
>> > >> 
>> > >> 
>> > >> Adrian
>> > >> 
>> > >> 
>> > >> On 26 July 2012 04:35, Aleksandr Rybalko <ray@freebsd.org>
>> > >> wrote:
>> > >> > Hi,
>> > >> >
>> > >> > I believe what Jason Evans done many test before commit
>> > >> > jemalloc, but made by myself simple test for embedded
>> > >> > environment. And get following results:
>> > >> >
>> > >> > 1. old malloc:
>> > >> > Sum of RSS of userland programs: 28544K
>> > >> >
>> > >> > sysctl vm.vmtotal:
>> > >> > System wide totals computed every five seconds: (values in
>> > >> > kilobytes) ===============================================
>> > >> > Processes:              (RUNQ: 1 Disk Wait: 1 Page Wait: 0
>> > >> > Sleep:
>> > >> > 19) Virtual Memory:         (Total: 2372224K Active: 250316K)
>> > >> > Real Memory:            (Total: 18096K Active: 11392K)
>> > >> > Shared Virtual Memory:  (Total: 15824K Active: 5288K)
>> > >> > Shared Real Memory:     (Total: 2644K Active: 2408K)
>> > >> > Free Memory:    2192K
>> > >> >
>> > >> >
>> > >> > 2. jemalloc with MALLOC_PRODUCTION:
>> > >> > Sum of RSS of userland programs: 21196K
>> > >> >
>> > >> > sysctl vm.vmtotal:
>> > >> > System wide totals computed every five seconds: (values in
>> > >> > kilobytes) ===============================================
>> > >> > Processes:              (RUNQ: 1 Disk Wait: 1 Page Wait: 0
>> > >> > Sleep:
>> > >> > 19) Virtual Memory:         (Total: 2380988K Active: 257820K)
>> > >> > Real Memory:            (Total: 19048K Active: 12144K)
>> > >> > Shared Virtual Memory:  (Total: 16180K Active: 5392K)
>> > >> > Shared Real Memory:     (Total: 2664K Active: 2392K)
>> > >> > Free Memory:    2440K
>> > >> >
>> > >> > I check it on DIR-632(Atheros AR7242 with 32M RAM) between
>> > >> > 10-20 mins of uptime. Device behave identical in both cases.
>> > >> >
>> > >> > So if "something" new take more memory than before, that
>> > >> > "something" is not a jemalloc :)
>> > >> >
>> > >> > P.S. Many thanks to Jason for such great job!
>> > >> >
>> > >> > WBW
>> > >> > --
>> > >> > Aleksandr Rybalko <ray@freebsd.org>
>> > 
>> > Hi all,
>> > 
>> > so, unlike both jemallocs, Poul's version of malloc born with more
>> > free memory:
>> > 
>> > Sum of RSS of userland programs: 25444K
>> > 
>> > sysctl vm.vmtotal:
>> > System wide totals computed every five seconds: (values in
>> > kilobytes) ===============================================
>> > Processes:              (RUNQ: 1 Disk Wait: 1 Page Wait: 0 Sleep:
>> > 19) Virtual Memory:         (Total: 2163524K Active: 59196K)
>> > Real Memory:            (Total: 16656K Active: 10144K)
>> > Shared Virtual Memory:  (Total: 5620K Active: 5200K)
>> > Shared Real Memory:     (Total: 2552K Active: 2356K)
>> > Free Memory:    3140K
>> > 
>> > But after half a day with some minor activity (logs on tmpfs,
>> > racoon connect attempts, etc.) free memory goes down to:
>> > 
>> > Free Memory:    2316K
>> > 
>> > and continue get more and more memory, after full day, it is around
>> > 1.5M free.
>> 
>> It is ok to have "low" free memory.  The kernel will just keep file
>> data cached around forever if it can.  When free memory hits a
>> certain target, then the pagedaemon process will wake up and shuffle
>> some inactive pages down to "cache" to free up more memory.
>> However, until that happens cached file data will just stay in
>> "inactive" and the kernel will keep using "free" pages.
>> 
>> -- 
>> John Baldwin

Hi John,

I'm just do simple test in well known environment, since it is not a PC
with 300 items in /etc/rc.d, but just small box with small count of
processes and even w/o RTC. So every time at boot the box doing exact
same job. Knowing that I can compare basically allocators. Of course it
is not precise and I don't tweak malloc flags. Only simple test to know
where we go :)

Thank you John!

WBW
-- 
Alexandr Rybalko <ray@dlink.ua> 
aka Alex RAY <ray@ddteam.net>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120801142418.f56aa606.ray>