Date: Wed, 6 Dec 2000 13:39:46 -0800 (PST) From: Matt Dillon <dillon@earth.backplane.com> To: Remy Nonnenmacher <remy@boostworks.com> Cc: phk@critter.freebsd.dk, freebsd-hackers@FreeBSD.ORG Subject: Re: free() not freing pagedirs pages. Message-ID: <200012062139.eB6LdkE99051@earth.backplane.com> References: <200012061907.UAA31917@luxren2.boostworks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
: :OK. In fact my problem was just a printf that allocated a buffer via :__smakebuf at the very last moment (when all memory was allocated). :This prevent free() to give back all previous pages up to this one. The :problem was _not_ in malloc.c. : :Anyway, i learned a lot from hacking the source to catch the caller. :Thanks. : :RN. :IhM Not to mention library routines which might malloc() something and keep it around. I find that the best way to allocate a large chunk of memory is to use mmap( ... MAP_ANON ... ). That way you have complete control over the memory. You need only page-align the request size (getpagesize() helps there). You can then manage the memory with madvise(), and free it completely with munmap(). -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012062139.eB6LdkE99051>