Path: utzoo!attcan!uunet!mailrus!ames!pasteur!ucbvax!thumper.bellcore.com!nsb From: nsb@thumper.bellcore.com (Nathaniel Borenstein) Newsgroups: comp.soft-sys.andrew Subject: Re: Help and its memory usage behavior Message-ID: Date: 20 Mar 90 18:24:20 GMT References: <0a1Z=ja753w7E0eogH@gazelle.att.com> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 29 Clearly the business with the directory search path is simply a bug, which should be fixed. The matter of the buffers is probably more disputable, so I wanted to add my opinion: Buffers make sense in ez, where users often know about buffer-oriented operations. They make very little sense in help. I'm not convinced there's any reason to use buffers at all in help, and I'm highly skeptical that the buffers should be preserved once they're no longer visible. (Conceivably you might want a heuristic, so that the longer troff-derived help files, such as "csh", would be preserved in a buffer so that you didn't have to run rofftext on them twice. But mostly, it is so quick to read in a new help file that it is silly to waste the memory by keeping it around.) Finally, I want to draw to the attention of everyone concerned that there is a wonderful tool included in Andrew for digging out core leaks. This is the "plumber" function, included with Andrew's malloc (and therefore available only if you've compiled with ANDREW_MALLOC_ENV defined). If you've got this defined, the text object will add some bindings (^X^@t and ^X^@m) that will, respectively, write to a file or print on the printer a lot of information about what has been malloced so far, including the address of the routine that made the malloc calls. You can scan through this list for the big offenders (especially for the leaks by comparing consecutive malloc dumps) and then use a debugger to find out what procedure corresponds to the offending hex address (in gdb, type "br *0xhex-addr" and it will tell you the name of the routine if the appropriate symbol table has been loaded). In the past, I've found this an invaluable tool for digging out core leaks, so I thought I should mention it on this list.