Subject: Re: memory leak in pine??

From: [email-masked] (Tim Mooney)
Date: 31 Jul 1996 19:15:25 -0500

In article <[email-masked]>,
ADAM Sulmicki <[email-masked]> wrote:
  
> I think it happens after I open an folder of 9'500 messages

Just out of curiousity, on a good day how long does it take to open a folder
with 9k messages in it?

Tim
-- 
Tim Mooney                              [email-masked]
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Bldg.                 (701) 231-8541 (FAX)
North Dakota State University, Fargo, ND 58105

---

From: ADAM Sulmicki <[email-masked]>
Date: Mon, 5 Aug 1996 22:02:58 -0400 (EDT)

->> I think it happens after I open an folder of 9'500 messages
->
->Just out of curiousity, on a good day how long does it take to open a folder
->with 9k messages in it?

:)

 Let see...Trying to open saved-messages.. it took about 1 min and 10
second, and it had around 10350 messages and load went up aprox to 0.16..
perhaps I should renice pine to -25 :)

But I gave up on using pine for anything else than looking inbox folders,
becuse if try open something a bit bigger I get "gifted" w/ something like
this (even if I close the folder pine does not give back what it once took)

19917 adam      33    0   26M   12M sleep   0:33  0.04%  0.03% pine

Cureently I use glimpse to look over my old mail very cool and fast and
pretty useful tool for searching texts of 100mb magnitude.

Well gotta quit pine to get its memory usage to sane limits.. but you can
try simple experiment, run 'top' at one window , and in other just try
open differnet folders using pine in another window, and you notice that
pine is eating more and more memory when you open consecutive folders, and
is never giving it back.

-Adam

13 vigrid% dir
total 51467
-rw-------   1 adam      5909301 Aug  5 21:49 archive
drwxr-xr-x   2 adam          512 Aug  5 21:51 inbox.mail/
-rw-------   1 adam      8899980 Jul 14 02:54 mail.old
-rw-------   1 adam         1282 Aug  5 12:04 postponed-msgs
-rw-------   1 adam     20630710 Aug  5 21:50 saved-messages
-rw-------   1 adam     13244699 Jun 21 11:53 saved-messages.spring.96
-rw-------   1 adam      3938050 Aug  5 21:40 sent-mail
14 vigrid% uptime

  9:53pm  up 33 day(s), 22:27,  1 user,  load average: 0.14, 0.16, 0.21
15 vigrid% 

-Adam

---

From: Mark Crispin <[email-masked]>
Date: Tue, 6 Aug 1996 00:03:09 -0700

Most implementations of malloc() do not give back memory.  Pine is giving
the space back, but that just causes more free space in the malloc() arena
and not reducing the process memory size.  This is all due to UNIX's need
to be compatible with the days when it ran on a 32K PDP-11...  ;-)

If you are going to use 20MB folders on a regular basis, I strongly
suggest that you look into converting to tenex format.  The standard UNIX
format requires that a completely in-memory snapshot be made of the entire
folder.  This is not the case with tenex format, and this results in
substantial savings.  The disadvantage with tenex format is that most
other mail programs don't recognize it.

>   9:53pm  up 33 day(s), 22:27,  1 user,  load average: 0.14, 0.16, 0.21

-- Mark --	Read http://www.imap.org for the "best kept secret in email"

DoD #0105, R90/6 pilot, FAX: (206) 685-4045  ICBM: N 47 39'35" W 122 18'39"
Science does not emerge from voting, party politics, or public debate.

---

From: [email-masked] (Tim Mooney)
Date: 7 Aug 1996 11:45:31 -0500

In article <[email-masked]>,
> to be compatible with the days when it ran on a 32K PDP-11...  ;-)

True, but that's not to say that a program can't give back memory to the OS,
really.  The old way was with sbrk(); the new way appears to be with mmap()
and munmap().  I haven't looked at the code, but it's possible in theory 
( :-) ) to make pine act more responsibly with regard to memory use.

Tim
-- 
Tim Mooney                              [email-masked]
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J1, IACC Bldg.                 (701) 231-8541 (FAX)
North Dakota State University, Fargo, ND 58105