From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,19771145c5594926 X-Google-Attributes: gidfa528,public From: Robert Mulley Subject: Re: Memory Management Date: 2000/11/17 Message-ID: <3A151688.651E2D95@gnsconsulting.com.au>#1/1 X-Deja-AN: 694698492 Content-Transfer-Encoding: 7bit References: <3A11AFE6.194B9261@virgin.net> <8uvnlp$8ek$1@news.nuri.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@mailint03.im.hou.compaq.com X-Trace: mailint03.im.hou.compaq.com 974460549 7608 16.37.50.195 (17 Nov 2000 11:29:09 GMT) Organization: Compaq Computer Corp. Mime-Version: 1.0 Reply-To: robert@gnsconsulting.com.au NNTP-Posting-Date: 17 Nov 2000 11:29:09 GMT Newsgroups: comp.unix.tru64 Hugh, I remember reading somewhere that, malloc/free combo only release memory back into re-use by the program. ie you malloc 2 Gb of memory, then free it, it only gets released back for further mallocs by the same program. I can't remember where I saw that. I just read something else, which says that it is designed this way for application performance methods. As the memory once malloc'ed/free'ed is still attached to the program future malloc's are much quicker, ie doesn't have to request memory from the system, system reduce UBC size to allocate the memory to the program etc... A possible workaround might be to use mmap and munmap for large allocate large areas of memory, or use shared memory segments. Good luck. Robert Mulley Unix Admin Hugh Patrick wrote: > Does this assume that the system was configured for deferred swap allocation > mode? I think our system was configured for immediate swap allocation. > > My understanding of immediate swap mode is that it's the virtual process > size that drives swap space usage which made me suspicious when I saw the > differences in the VSZ column of the output from the ps command. Perhaps it > isn't as simple as I would like to think. > > There were two points that I didn't make clear in the initial posting > (a common failing of mine - sorry): > 1. In reality many users executing the same application. So, the kernel > freeing/not freeing VM when a process free()'s memory would make a real > difference on the amount of swap being used. > 2. The swap space size wasn't modified by the upgrade from Tru64 3.2 to 4.0. > > Hugh > > Park, Byoung-Kyu wrote in message > news:8uvnlp$8ek$1@news.nuri.net... > > Checking the swap area. > > => #swapon -s > > > > Program executing is memory load and allocation swap space. > > so, messages display that low swap space > > ex> recommand swap space = Physical memory * 2.5 or 3.0 > > > > > > "root" wrote in message > > news:3A11AFE6.194B9261@virgin.net... > > > This is a historic question. > > > > > > We upgraded from Tru64 3.2G to Tru64 4.0F some time ago. When we ran > > > our application on 4.0F we started getting "Low swap space" warnings > > > that we did not get under 3.2G. > > > > > > Looking at the VSIZE column of the 'ps' output I noticed that under 4.0F > > > memory allocated to a process is not released back to the operating > > > system - i.e. VSIZE only ever increases. Under 3.2G the > > > VSIZE fluctuates up and down. > > > > > > I wrote the following simple test C program: > > > > > > #include > > > #include > > > #define MB (1024*1024) > > > void main(void) > > > { > > > char *mem_block1; > > > char *mem_block2; > > > > > > mem_block1 = (char *)malloc(50*MB); > > > mem_block2 = (char *)malloc(50*MB); > > > getchar(); /* give chance to run ps */ > > > free(mem_block2); > > > get_char(); /* give chance to run ps */ > > > } > > > > > > Under 4.0F the VSIZE is approx 100Mb + some process overhead > > > Under 3.2G the VSIZE is approx 50MB + some process overhead. > > > > > > Unfortunately I no longer have access to the 3.2G box. > > > > > > Does anyone know for certain if the memory management was changed from > > > 3.2, in which malloc()/free() off-loaded all memory management to the > > > kernel, and 4.0F which appears to expect the user processes to manage > > > free space with malloc()/free()? I'm guessing this change (if I'm > > > right) was made for kernel efficiency - for example, less scanning of > > > free lists, less swap allocation/deallocation activity, etc. > > > > > > Regards, > > > Hugh Patrick > > > > > > > > > >