Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2008 18:18:10 +0300
From:      Igor Sysoev <is@rambler-co.ru>
To:        freebsd-current@FreeBSD.ORG
Subject:   malloc(3) ignores RLIMIT_DATA
Message-ID:  <20080219151809.GF57366@rambler-co.ru>

next in thread | raw e-mail | index | archive | help
malloc(3) in FreeBSD 7 uses mmap() (then sbrk() on 32-bit platform)
and ignores RLIMIT_DATA. FreeBSD 8's malloc() can be configured
to use sbrk() only ("Dm"), but default setting is "DM".

Instead of gracefully handling ENOMEM condition processes grows and
swaps out, causing livelock.

Using RLIMIT_AS (aka RLIMIT_VMEM) as suggested interacts badly
with stack growth in process low memory condition.

As sbrk() is less preferable because of framentation and race conditions,
why not to create mmap() flag MMAP_DSS to check RLIMIT_DATA and to use it
in malloc(3) ?


-- 
Igor Sysoev
http://sysoev.ru/en/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080219151809.GF57366>