Date: Thu, 9 Jun 2011 15:10:12 -0400 From: Ryan Stone <rysto32@gmail.com> To: freebsd-hackers@freebsd.org Subject: Large data segments interact poorly with MALLOC_OPTIONS=M Message-ID: <BANLkTik5wZd0BoZTL11HoXC2fSLHpoSq3w@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
At $(WORK) I've been porting our applications from FreeBSD 6 to FreeBSD 8. One of our daemons tends to be a big memory hog, so we set a data segment size of 1.5GB to accommodate it. This ends up breaking horribly now that malloc uses mmap to allocate memory by default. What happens is that malloc ends up exhausting all of the address space outside of the data segment first(with mmap) before using any of the data segment(with sbrk). Meanwhile, other users of mmap can only allocate address space outside of the data segment. This includes pthread_create, which allocates the thread's stack directly via mmap. Is the recommendation with jemalloc to make the data segment as small as possible, to avoid these types of issues?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTik5wZd0BoZTL11HoXC2fSLHpoSq3w>