Subject: Pico sucking oodles of memory

From: "Robert A. Hayden" <[email-masked]>
Date: Mon, 13 Dec 1993 01:25:17 -0600 (CST)

I noticed something....

Ok, I started up pico on my home Linux machine editing a 1.6MB file.

---

But this is what ps -u is giving me:

USER        PID %CPU %MEM SIZE  RSS TT STAT START   TIME COMMAND
root        938 18.7 72.9 12956 5024  2 S    01:09   0:42 pico -z research2

---

This is the entry for the file I am editing:
-rw-------   1 root     root      1656585 Dec 13  1993 research2

---

Finally, this is the same ps -u entry for running pico WITHOUT a file:

USER        PID %CPU %MEM SIZE  RSS TT STAT START   TIME COMMAND
root        979  1.6  4.1  200  284  3 S    01:18   0:00 pico

-------

Is there some reason why pico is using over 7x the memory of the file it 
is editing?  I can see it having to load all 1.6 megs of data into memory 
to work with it, but something doesn't seem right here....

____         Robert A. Hayden          <=> [email-masked]
\  /__           -=-=-=-=-             <=>          -=-=-=-=-
 \/  /    Finger for Geek Code Info    <=> Veteran of the Bermuda Triangle
   \/   Finger for PGP 2.3a Public Key <=> Expeditionary Force -- 1993-1951
-=-=-=-=-=-=-=-
(GEEK CODE 1.0.1)  GAT d- -p+(---) c++(++++) l++ u++ e+/* m++(*)@ s-/++
		       n-(---) h+(*) f+ g+ w++ t++ r++ y+(*)

---

From: David L Miller <[email-masked]>
Date: Mon, 13 Dec 1993 09:25:00 -0800 (PST)

Robert,

Pico does use a fairly memory intensive internal format for the text. 
Basically, you are looking at 12*nl+2*nc, where nl is the number of lines and
nc is the number of characters, exclusive of newlines.  Actually, it could be
12*nl+4*nc, depending on how the compiler handles the CELL struct.  For 
details, see the definitions of CELL and LINE in pico/estruct.h.

Thanks for the report!

--DLM

|\ |  |\/|  David L. Miller    [email-masked]  (206) 685-6240
|/ |_ |  |  Software Engineer, Pine Development Team   (206) 685-4045 (FAX)
University of Washington, Networks & Distributed Computing
4545 15th Ave NE, Seattle WA 98105, USA