Everhart, Glenn From: music@erich.triumf.ca Sent: Monday, December 14, 1998 1:56 PM To: Info-VAX@Mvb.Saic.Com Subject: Deallocating pages in the pagefile The following program is a test program used to consume (allocate) pagefile and then try to free it up (deallocate). Unfortunately, it appears that after the pages have been deallocated, the count of the pages in use has not actually been updated (as known by the process's pagefile quota in use). Apparently, the pagefile is really freed up when the image is run down. This implies that the operating system can free up the pagefile without terminating the process but just by image rundown, so it seems reasonable that the image should be able to also force the pages to be freed up (as known by the process's pagefile quota in use). In fact, I am rather surprised that this does not happen automatically when the pages are deallocated. The impact of this behavior for some images is rather catastrophic. For example, an image that may run continuously (for weeks on end) may occasionally need a lot of memory but only for a short time. If there are a lot of these images and they do not free up their portion of the pagefile when they deallocate memory then the overall pagefile must be MUCH larger than it actually needs to be if the pages were freed up. AMDS (avail) was used to monitor the pagefile use for the process as the image was run and then stopped. Is there a way to free up the deallocated pages in the pagefile without stopping the image? program test implicit none integer*4 alloc_num, max_alloc_num parameter (max_alloc_num = 100) integer*4 base_address(max_alloc_num) integer*4 num_of_pages/1000/, dealloc_num do 100 alloc_num = 1, max_alloc_num type *, 'allocation # ', alloc_num call lib$get_vm_page ( num_of_pages, base_address(alloc_num)) 100 continue pause do 200 dealloc_num = 1, max_alloc_num type *, 'deallocation # ', dealloc_num call lib$free_vm_page ( num_of_pages, base_address(dealloc_num)) 200 continue pause stop end Fred W. Bach , Operations Group | Internet: music@triumf.ca TRIUMF (Canada's National Meson Lab.) | Voice: 604-222-1047 loc 6278/6327 4004 WESBROOK MALL, UBC CAMPUS | FAX: 604-222-1074 University of British Columbia, Vancouver, B.C., CANADA V6T 2A3 "Accuracy is important. Details can mean the difference between life & death." These are my opinions, which should ONLY make you read, think, and question. They do NOT necessarily reflect the views of my employer or fellow workers.