This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Allow shrinking of arena heaps using mmap based onovercommit settings when available
On Thu, 23 Aug 2012 13:53:21 -0700 (PDT), Roland wrote:
> > + static int may_shrink_heap = -1;
> > +
> > + if (__builtin_expect (may_shrink_heap < 0, 0))
> > + may_shrink_heap = check_may_shrink_heap ();
>
> Just call check_may_shrink_heap () directly in the use below.
> Leave it to the malloc-sysdep.h inline to cache or whatnot.
>
That would lead to /proc/sys/vm/overcommit_memory being opened and
closed with every call to shrink heap on Linux. The general case would
be fine. Do we really want that?
Regards,
Siddhesh