Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!turnkey!orchard.la.locus.com!devnet.la.locus.com!richp From: richp@locus.com (Richard L. Pettit Jr.) Newsgroups: comp.windows.x.motif Subject: Re: Vanishing Server Resources with Motif1.0 Application Message-ID: <1991Jun27.144542.2521257@locus.com> Date: 27 Jun 91 14:45:42 GMT Reply-To: richp@locus.com Organization: Locus Computing Corporation, Los Angeles, California Lines: 42 Clifford Luke sez: > He is running Motif1.0 >and an R3 based Server. > >There have been reports of "memory leaks" in earlier versions of Motif, >due to memory not being freed when widgets are destroyed, leading to >clients which "grow in size". > >Has anybody observed similar problems on the server side caused by Motif >not destroying widgets correctly (ie. server resources not being released)? >If so will updating to Motif 1.1.2 alleviate these problems? There are 3 problems at work here (that I know of in Motif 1.0 & X11R3). 1) If backing store is on, server memory vanishes. Start the server with -bs to defeat this. 2) If Mwm*saveUnder is true you will be in deep poop in no time flat. Make it false. 3) If the memory allocator in the X server is first-fit not best-fit then uglyisms like this happen: p = Xalloc(7000000); /* not enough memory, sbrk() */ Xfree(p); /* return to pool */ q = Xalloc(1000); /* 1000 < 7000000 use this chunk and leave 6999000 */ p = Xalloc(7000000); /* not enough memory, sbrk() */ Really, 3 is the big problem and 1 and 2 simply give the server copious opportunity for it to happen. Life with X has become correct since I started the X -bs and Mwm*saveUnder: false gig. There may also be a problem in XmStringFree() not freeing all of the resources allocated by XmStringCreate*(). Scribble a test program that spins in a loop allocating and freeing and see if the process grows. Rich -- ---- Richard Pettit Locus Computing Corp. richp@locus.com "Opinions expressed herein are of the author, not (LCC or IBM)"