From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <7b27f6e8ba51955a67e7c1997324b21f@plan9.bell-labs.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] plan 9 overcommits memory? Date: Mon, 3 Sep 2007 11:28:22 -0400 From: Sape Mullender In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: b54d7fd4-ead2-11e9-9d60-3106f5b1d025 >> It would be cool to be able to get a handle on being able to shrink >> the memory occupied by an application dynamically. Malloc (through >> brk()) grows the memory footprint, but free does not shrink it. >> The same is true for the stack. Once allocated, it doesn't get freed >> until the process exits. > > yes it would. does plan 9 have programs that could make use of this > currently? No, and it would be hard to do it because you'd need ways to compact fragmented memory after a lot of mallocs and frees. And then, you'd need a way to fix the pointers after compacting. Sape