Path: utzoo!attcan!uunet!samsung!usc!ucsd!ucbvax!mtgzx.att.com!jis From: jis@mtgzx.att.com (J Mukerji) Newsgroups: comp.soft-sys.andrew Subject: Help and its memory usage behavior Message-ID: Date: 16 Mar 90 22:32:46 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 68 I was playing around with help to see how much memory it uses, and was amazed to see how quickly it eats up memory. As an example here is a list of actions that were taken in help and the result of running "pstat -s" on a Sun 4/60 with 12M memory 16M swap space: (pstat -s gives the disposition of the swap space) Before starting help 6980k allocated + 2920k reserved = 9900k used, 6480k available Bring up help (tour.help 5300 bytes) 7588k allocated + 3736k reserved = 11324k used, 5056k available Delta: 1424k Tag console in help (console.help ~19k) 7716k allocated + 3736k reserved = 11452k used, 4928k available Delta: 128k See help for sh involving troff-ing the manual page (sh.1 ~41.5k) 8512k allocated + 3756k reserved = 12268k used, 4112k available Delta: 816k Tag table help (table.help 56.4k) 8640k allocated + 3760k reserved = 12400k used, 3980k available Delta: 132k Tag ness help (ness.help 11k) 8696k allocated + 3744k reserved = 12440k used, 3940k available Delta: 80k See help for ls involving troff-ing the manual page (ls.1v 7.7k) 8864k allocated + 3736k reserved = 12600k used, 3780k available Delta: 160k Ooops clicked on ls again (ls.1v 7.7k) 9008k allocated + 3732k reserved = 12740k used, 3640k available Delta: 140k back to console (console.help ~19k) 9052k allocated + 3736k reserved = 12788k used, 3592k available Delta: 48k clicked on console again (console.help ~19k) 9076k allocated + 3740k reserved = 12816k used, 3564k available Delta: 28k Exit help 7004k allocated + 2916k reserved = 9920k used, 6460k available Delta: -2896k I have included the size of the raw help files that are being read in at each stage. I have also shown the rough difference in available memory after each step in the field marked "Delta: xxxk". What boggles my mind is that enormous amounts of memory seem to be getting allocated and it seems very little of it is getting freed for reuse. In short there seems to be a very large memory leak somewhere in Help. Is this a phenomenon peculiar to SPARCs or is it a general memory leak bug in Help? Either way has anyone got any ideas about how I or someone else ought to go about plugging this leak? Thanks. Jishnu Mukerji, jis@mtgzx.att.com, +1 201 957 5986, AT&T Bell Laboratories, MT 3K-423, 200 Laurel Ave., Middletown NJ 07748