Date: Sun, 28 Jan 2001 11:36:40 +0200 From: "Kobi Luz" <kobi@cwnt.com> To: <freebsd-questions@freebsd.org> Subject: regarding use of mmap against brk in malloc Message-ID: <001501c0890d$d1e65fd0$db00a8c0@KOBI>
next in thread | raw e-mail | index | archive | help
Hi. The current implementation of malloc, uses brk() and sbrk() to allocate new pages from the OS. As the allocated pages are successive, pages are returned to the OS only when the last page is free, which often does not happen. This creates a situation where almost no memory is returned to the OS even after being freed by the process. We want to use calls to mmap() instead of brk() to address this problem. Is there any reasons we should know about why we should not use only calls to mmap(), and not use calls to brk() at all in the implementation of malloc? Are there any advantages for brk() over mmap() (like performance issues) that we should know about, or any problems with the use of mmap() in malloc? Thanks a lot, Kobi Luz. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001501c0890d$d1e65fd0$db00a8c0>