tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: malloc() exceeds RLIMIT_DATA



On Mon, Jul 08, 2019 at 06:06:34PM -0700, Graham Percival wrote:
> Thomas Klausner (wiz@) suggested that I write to this list.  It appears that
> NetBSD's malloc() will allocate more than RLIMIT_DATA's rlim_max.

The classical "data segment" (limited by RLIMIT_DATA) is not used much
nowadays in NetBSD. Especially malloc() does not use it.

     RLIMIT_DATA     The maximum size (in bytes) of the data segment for a
                     process; this defines how far a program may extend its
                     break with the sbrk(2) system call.


In ancient times malloc allocated memory via sbrk(2), but nowadays it uses
mmap(2) with anonymous memory.

Martin


Home | Main Index | Thread Index | Old Index