Path: utzoo!attcan!uunet!cs.utexas.edu!usc!wuarchive!mit-eddie!bloom-beacon!MITVMA.MIT.EDU!CS727713%HKPCC.HKP.HK From: CS727713%HKPCC.HKP.HK@MITVMA.MIT.EDU ("Stephen Wong ", Hong Kong Poly. - Computing Dept.) Newsgroups: comp.windows.x Subject: Re: Memory Deallocation of XtDestroyWidget? Message-ID: Date: 14 Dec 90 20:14:00 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 21 >Hello, > I am looking into the memory usage by the Motif and Xt. What I did >was to load in some 100 push button widgets at run-time (invoked using Callback ) >from a UID file, then destory these widgets on another press of a button. >However,the SZ and RSS have increased rather than decreased. >What have I done wrong? I thought the XtDestroyWidget is to destroy the >widget and free the memory. This kind of behaviour is normal in Unix world. Most (or all) implementations or malloc, which Xt calls, can grab memory from the system pool, but after that, it cannot release the memory back to the pool. What malloc does, is still reserving the freed memory for future malloc use. And that's why you can't see your memory usage decrease. Later release of Unix may consider to let free function to return memory to system pool. Regards, Stephen Wong. (Internet:cs727713@hkpcc.hkp.hk)