"ara.t.howard" <ara.t.howard / gmail.com> writes:

> On Oct 11, 2007, at 6:40 AM, Yohanes Santoso wrote:
>
>> But most importantly, one should know that RSS and VSZ are not
>> Accurate Measure of Memory Usage.
>>
>> YS.
>
> sorry, for jumping in, but i'd love your opinion on this yohanes:
>
>   http://drawohara.tumblr.com/post/14421265

Ah, I'm sorry. I have been swamped recently and has not been able to
read this mailbox.

Too bad you're on Darwin. Had you been on Linux (and on glibc), I'd
suggest you to patch ruby so that it executes this first thing after
it starts:

  mallopt(M_MMAP_THRESHOLD, 0); /* declared in malloc.h */

What this does is to make all allocation using mmap instead of
sbrk. This allows all free() to return the allocated space back to the
kernel. Doing this eliminates the possiblity that VSZ climbs because
of memory fragmentation. If VSZ still climbs, then there are some
garbage somewhere not released. OTOH, this causes syscall for every
allocation.

I hope there is a suitable equivalent in Darwin.

YS.