lkml.org 
[lkml]   [2004]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmap + mprotect + malloc strange behaviour
Kaloian Manassiev wrote:

>Nevermind, I found it :)
>
>I just found out (by reading
>/usr/src/linux-2.4.20-8/Documentation/sysctl/vm.txt)
>that there is a limit on the number of mappings that a
>process may have and that for some reason malloc
>consumes mappings.
>
>I just increased the limit by editing the file
>/proc/sys/vm/max_map_count. This works okay for my
>application...
>
>Does someone know what repercussions this could have
>on the "normal" operation of the system?
>
>Cheers,
>Kaloian.
>
>
>
>
The glibc malloc heap switches to using mmap()/munmap() for large
allocations (>=128kbytes ?). This behaviour can be turned off by setting;

export MALLOC_TRIM_THRESHOLD_=-1
export MALLOC_MMAP_MAX_=0

See also the mallopt() library call.


Cheers
Addy.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.041 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site