[Xcb] [RFC] XCB without use of malloc()

Maxim Levitsky maximlevitsky at gmail.com
Mon Jan 7 19:43:25 PST 2008


On Tuesday, 8 January 2008 01:53:54 Donnie Berkholz wrote:
> On 14:23 Sun 06 Jan     , Maxim Levitsky wrote:
> > Probably you are right. I wish glibc developers would use mmap() more often 
> > instead of that large brk() that only keeps growing.
> 
> You can configure that. From my environment setup file:
> 
> # Use brk() rather than mmap(), which is basically a tradeoff in memory
> # for better performance
> 
> #          The maximum number of chunks to allocate with `mmap'.
> #          Setting this to zero disables all use of `mmap'.
> MALLOC_MMAP_MAX_="0"
> #          All chunks larger than this value are allocated outside the
> #          normal heap, using the `mmap' system call.  This way it is
> #          guaranteed that the memory for these chunks can be returned
> #          to the system on `free'.  Note that requests smaller than
> #          this threshold might still be allocated via `mmap'.
> MALLOC_TRIM_THRESHOLD="-1"
> 
> Thanks,
> Donnie
> 


Well, I have meant  the opposite, I would like the memory to be allocated by mmap()
instead of brk(), so it could be freed.

Probably this will to it:
MALLOC_TRIM_THRESHOLD=0

Best regards,
	Maxim Levitsky


More information about the Xcb mailing list