Messages in this thread | | | Date | Wed, 14 May 1997 09:46:58 -0700 | From | "Leonard N. Zubkoff" <> | Subject | Re: Returning "freed" memory to system |
| |
Date: Wed, 14 May 1997 12:02:14 -0400 (EDT) From: yuri mironoff <yuri@buster.rgti.com>
I remember a discussion about returning "freed" memory to the system while the process is still executing. Apparently AIX has a mechanism for forcing this to happen. Is this an AIX or POSIX thing, and if so would this be a good thing to implement?
(Excerpt from IBM rep follows: )
...if a large structure is used early and then left untouched for the remainder of the program, it should be released. It is not sufficient to free the space that was malloced or calloced. free releases only the address range that the structure occupied. In order to release the real memory and paging space, you must disclaim the space as well.
disclaim Subroutine
Actually, returning "freed" memory was not the primary purpose of page disclaim at all. When I was tuning Lucid Common Lisp to Apollo's Domain/OS, I used an undocumented system call to dramatically improve the paging performance of the Lisp system. MST_$Invalidate allowed one to "invalidate" a region of memory; the address range was invalidated and when the memory was next referenced the process would get a fresh page of zeroes rather than whatever contents it had previously. With a two space stop and copy garbage collector in a system where paging is occurring due to insufficient real memory, after the live data is copied from old space to new space the entire old space is likely to be paged out as operation continues, and then eventually paged back in when the next garbage collection occurs. By invalidating old space after garbage collection, this useless page-out/page-in activity is prevented.
At one point (circa 1986 or 1987) IBM asked Lucid if there was anything the OS could do to improve performance, and I explained how MST_$Invalidate had dramatically improved performance on the Apollos. The page disclaim system call was their response.
Leonard
| |