Subject: RE: calloc() and free() ps doesn't report memory being freed, why?
To: 'Ron G. Minnich' <rminnich@Sarnoff.COM>
From: John Maier <JohnAM@datastorm.com>
List: netbsd-users
Date: 04/23/1997 21:09:19
munmap() works, for the most part. The RSS is back to normal (544K as   
opposed to 2100K), however the VSZ part of memory is still 2200K.

Just out of curiosity, should I use a free() before I use munmap()?

My novel approach to getting so memory back was to fork() and kill the   
parent process.  Not real efficient but worked!

Thanks,
jam

 ----------
From:  Ron G. Minnich
Sent:  Monday, July 29, 1996 2:11 PM
To:  netbsd-help@NetBSD.ORG
Subject:  Re: calloc() and free() ps doesn'r report memory being freed,   
why?


> The only way to enforce this is to mark the memory as free, but keep it   
in the
> process's address space.

yep. If you want to allocate storage and then free pieces of your vm
space when you free storage, you could use a mapped-file-based allocater.   

Then freeing vm space is basically an munmap(). This does seem to work
under the various BSDs I've tried.

ron