Xref: utzoo comp.windows.x.motif:821 comp.unix.sysv386:826 Path: utzoo!utgpu!news-server.csri.toronto.edu!orasis.vis.toronto.edu!ai.toronto.edu!tjhorton Newsgroups: comp.windows.x.motif,comp.unix.sysv386 From: tjhorton@ai.toronto.edu ("Timothy J. Horton") Subject: Re: Memory Leak in Motif 1.0 Dialog Widgets (Interactive port) Message-ID: <90Sep29.043318edt.8243@orasis.vis.toronto.edu> Organization: Department of Computer Science, University of Toronto References: <34367@cup.portal.com> Distribution: na Date: 29 Sep 90 08:34:33 GMT Lines: 23 DeadHead@cup.portal.com (Bruce M Ong) writes: > The motif dialog widget - the selection box dialog - does >not seem to clean up its internal data when a new XtSetArg() is called >with a different item count and a different item list than the previous call. (Keep in mind that even if the widget cleans up, memory fragmentation will eventually cause your process to perpetually grow, however slowly.) I was worried enough about this problem that I wrote my own selection code -- using a draw window and a text widget -- because I use swap in *particularly* long lists -- 2000 at a time -- quite often. I can simply reset the item list pointer (to an existing array of string pointers) and the item count, and clear the window. It saves both in terms of memory utilization and processing. The code is maybe 300 lines, and carefully debugged, but it's not "widgetized" -- packaged up as a new widget. That would have been far too much work, to create such a specialized wheel, because I haven't written full-fledged widgets before. If anybody is experienced at writing widgets and would be willing to contribute this to the world, I'd contribute what I could. tjhorton@ai.toronto.edu uunet!jtsv16!geac!tse!cont1