How much ram does puppy need? Some test results

Using applications, configuring, problems
Message
Author
User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

How much ram does puppy need? Some test results

#1 Post by HairyWill »

I was bored the other evening and went through the last 6 releases and the current alpha 3 and checked how much RAM they used. The final figure is extracted from free after booting a frugal install with pfix fix=ram, xvesa as the xserver and nothing else running apart from mut/pmount, a rxvt window and a rox window

Code: Select all

version pup_file size(MB) unsquashed(MB) mem-usage-by-free-(MB)
2.13              66                          169                                 138
2.14              67                          171                                 142
2.16              71                          181                                 148
2.17              74                          189                                 151
3.00              77                          198                                 187
3.01              79                          200                                 200
3.93              63                          160                                 171
here is a chart

Image

The interesting bit in my anal opinion is that in the last few releases the RAM needed approaches the size of the uncompressed pup_xxx.sfs. In the current alpha it actually surpasses it. I am curious as to what causes this. It looks like slackware compatibility cost a lot of ram. The current alpha sfs is only 63MB, less than that of 2.13 yet it needs significantly more ram to run.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

Wolf Pup
Posts: 637
Joined: Fri 28 Apr 2006, 01:37

#2 Post by Wolf Pup »

does the mem-usage-by-free include or exclude the buffers and cached memory?
[img]http://img230.imageshack.us/img230/8595/ubd6467dp2.png[/img]
[url=http://www.tinyurl.com/54tu74]Visit The Repository[/url] - Helpful and hard-to-find treats for Puppy 3.
[url=http://www.tinyurl.com/c5a68f]Click Here for Puppy Support Chat, + Helpful Links.[/url]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#3 Post by HairyWill »

here are the lines from free

Code: Select all

                           total            used             free                   shared    buffers
2.13  Mem:       507276       141580       365696            0        16604

2.14  Mem:       507276       145432       361844            0        17400

2.16  Mem:       507276       152540       354736            0        17736

2.17  Mem:       507188       155080       352108            0        17500

3.00  Mem:       507236       191944       315292            0        17720

3.01  Mem:       507236       204856       302380            0        17596

3.93  Mem:       506852       175672       331180            0        15236
I don't know how to query cached memory
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

Leachim
Posts: 229
Joined: Sun 27 May 2007, 23:04

#4 Post by Leachim »

I use a very large Puppy - more than 1 GB sfs and more than 2 GB save-file - but have disabled loading into RAM (doesn't make sense with such file sizes). My Puppy runs on PCs with only 128 MB of RAM.

Bruce B

#5 Post by Bruce B »

Will,

I thought we had worked this out. That we were on the same page. No biggie.

You're testing is great, but you need the Full version of Free to do it.

Package contents:
  • 6348 2007-12-18 00:23 free*
    45088 2007-12-18 00:24 libproc-3.2.7.so*
Bruce

Note I think it is okay to overwrite busybox free link at least for a full install. If you don't want to then rename free.
Attachments
free.tar.gz
(25.01 KiB) Downloaded 450 times

User avatar
Dingo
Posts: 1437
Joined: Tue 11 Dec 2007, 17:48
Location: somewhere at the end of rainbow...
Contact:

#6 Post by Dingo »

Leachim wrote:I use a very large Puppy - more than 1 GB sfs and more than 2 GB save-file - but have disabled loading into RAM[...]
How? (I'm a Puppy newbie with very few RAM)

Bruce B

#7 Post by Bruce B »

Dingo wrote:
Leachim wrote:I use a very large Puppy - more than 1 GB sfs and more than 2 GB save-file - but have disabled loading into RAM[...]
How? (I'm a Puppy newbie with very few RAM)
Welcome Dingo!

I'm one of the guys who likes specificity. Not that I'm a retired investigator, I just want answers that can help me better help you. How much RAM do you have?

Some Answers:

With a Full install it won't load files from the HD into RAM except on an as needed basis.

With a Frugal install it wouldn't load files in into RAM except on an as needed basis. UNLESS Puppy calculates that you have enough RAM.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#8 Post by HairyWill »

Bruce B wrote:I thought we had worked this out. That we were on the same page.
I'm not sure what you mean. I don't think anyone has presented this information in this way before. I am specifically interested in the relationship between the size of the unsquashed pup_xx.sfs and the memory used
Thanks for the full version of free. I have also just looked at directly at /proc/meminfo
http://www.redhat.com/advice/tips/meminfo.html

Code: Select all

 while [ 1 ] ; do  echo --------------;cat /proc/meminfo ; sleep 1  ; done
You've said here:
http://www.murga-linux.com/puppy/viewto ... 388#148388
And those caches and buffers must be subtracted and I don't see this happening in these threads.
I don't really understand what effect the cached memory has on the minimum memory requirement. I don't why these must be subtracted. I am specifically talking about liveCD or frugal install here. Do you mean that the system will run even if space for the caches is not provided? I'm specifically interested in freeing the cd drive on a system with no swap.

If I go through the process of providing the output from full free, what extra conclusions might we be able to draw?
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
Dingo
Posts: 1437
Joined: Tue 11 Dec 2007, 17:48
Location: somewhere at the end of rainbow...
Contact:

#9 Post by Dingo »

Bruce B wrote: Welcome Dingo!
How much RAM do you have?
Hi and thanks for your answer! My RAM size, is not, really so few (256 MB) but hearing that is a way to economize RAM for applications like openoffice (so swapping is not needed). I say to me: why not try?
Bruce B wrote: With a Frugal install it wouldn't load files in into RAM except on an as needed basis. UNLESS Puppy calculates that you have enough RAM.
I have a frugal install in fact

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

#10 Post by alienjeff »

@Dingo

If you want to economize your RAM usage, a full HD installation would a better choice than frugal.

As with horsepower in automobiles, it's generally better to have more RAM. You may not use it all in normal use, but when you do need it, it's nice to have available!

@HairyWill

A thumbs up and tip of the hat on the chart and graph. Good work and much appreciated.

@multitude

Let's not let the BusyBox Free vs CoreApps Free matter devolve into a holy war as Root vs User seems to have ...
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

Bruce B

#11 Post by Bruce B »

I guess, Will, now that I know where you are coming from, I can explain it this way.

Linux likes to cache. But the cache is easily disposed of by Linux if you need the RAM for running an application not in cache. Conversely, there are other areas of RAM that Linux is actually using and will not and can not get rid of to make room.

Here is full version free output displayed in megabytes, one of the other features busybox free doesn't have.

Code: Select all

          total     used   free  shared  buffers  cached
Mem:       2535     190    2344       0       3     125
-/+ buffers/cache:   62    2473
Swap:       541       0     541
It says I'm using 190 MB RAM, but after factoring the buffers/cache I'm only really using 62MB.

Having 2.5GB RAM, I'm not in a crunch, but if I had 192 RAM, Linux would give up cache and buffers as it could for other tasks before using the swap file.

PS Great looking graph!

Also, the work you did fascinates me as an interest of mine. Very informative and educational. Just wished you hadn't used the busybox free (ever again)

The Redhat link was great, they has such a great product and following. Shame the put it to rest at version 9 and when for the commercial end. Except for Fedora, but it doesn't seem the same.


Bruce

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

#12 Post by alienjeff »

Good input, Bruce. Thanks. I'm fairly certain I know how you'd vote should someone start a poll on replacing BusyBox Free with CoreApps Free in Puppy. ;)

For anyone else following this thread, Torsmo (and fork app Conky, I suspect) can be configured in the file .torsmorc to show either Busybox or CoreApps-factored free memory.

Code: Select all

# Subtract file system buffers from used memory?
# no_buffers no     #uncomment this line to display BusyBox "free" 
# no_buffers yes    #uncomment this line to display CoreApps "free"
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#13 Post by HairyWill »

I've spent hours playing with this and learned very little, just in case someone else finds it enlightening here goes:

I created a script to automatically log the contents of /proc/meminfo whilst it opened and closed some applications.

Code: Select all

#!/bin/sh
LINE=`cat /proc/meminfo | tr -s ' ' ' '| cut -f 1 -d ' '`;echo time: $LINE
I=0
INTERVAL=5
while [ "$I" -lt 70 ] ; do LINE=`cat /proc/meminfo | tr -s ' ' ' '| cut -f 2 -d ' '`;echo $I $LINE;I=`expr $I + 1`;sleep 1; done &
sleep $INTERVAL
defaultbrowser &
sleep $INTERVAL
killall seamonkey-bin
sleep $INTERVAL
abiword &
sleep $INTERVAL
killall abiword
sleep $INTERVAL
defaultbrowser &
sleep $INTERVAL
abiword &
sleep $INTERVAL
gnumeric &
sleep $INTERVAL
gxine &
sleep $INTERVAL
mtpaint &
sleep $INTERVAL
killall seamonkey-bin
killall abiword
killall gnumeric
killall gxine
killall mtpaint
I booted 2.13,3.01 and 3.93 into ram and collected the output from running the script. I then stuffed all the data into a spreadsheet and created comparison charts between versions for all the values that did something interesting. I also made one for MemFree + Buffers + Cached shown below.

Image

I have attached the spreadsheet which contains all the data and lots of charts. If you are interested in the data for your system you could try running the script, collecting the output and substituting in your data for one of the tabs 213, 301 or 393, you will need to be competent with gnumeric. Beware that the last few lines in /proc/meminfo vary depending on your kernel.
Attachments
mem-analysis.gnumeric.gz
(34.29 KiB) Downloaded 437 times
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

#14 Post by alienjeff »

OMG very cool, HairyWill. Still digesting!
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#15 Post by 8-bit »

It was always my understanding that Puppy only loaded as much into ram as was available.
I have Puppy ver 214R full install with swap partition running on an OLD 133 mhz Compaq laptop.
We are talking 1.2gig hard drive and 32megs physical ram on it.

It boots slow, but comes up with the desktop and apps available and memory left too according to Free.
So I figure that a true memory needed test is having enough memory to hold the kernel and xwindow manager. The applications can be loaded as needed after that!

So you just might have to rethink your minimum memory requirements for
each version.
This is the report from free:

Mem: 28672 total 27356 used 1316 free 0 shared 536 buffers
Swap: 96760 total 2152 used 94608 free
Total: 125432 total 29508 used 95924 free

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

#16 Post by alienjeff »

8-bit wrote:It boots slow, but comes up with the desktop and apps available and memory left too according to Free.
So I figure that a true memory needed test is having enough memory to hold the kernel and xwindow manager. The applications can be loaded as needed after that!

So you just might have to rethink your minimum memory requirements for
each version.
We've drifted into the Semantics Zone, I'm afraid ...

Although 214R with a full HD install has loaded and runs on that Compaq, it's going "run" like a sloth. You'll note that there's 1316 free conventional memory and 2152 used of swap memory - which indicates that between the kernel, Xorg and the desktop, you're already into swap. HD thrashing is just moments away.

To say Puppy 214R will load and run on a 133MHz/32M box isn't technically false, but I fear many newcomers are arriving with preconceived notions of "fast" and "speed," which will not be the case with that box.

So it's not a case of HairyWill needing to rethink minimum memory requirements for each version, but is a case of the community needing to more clearly define the terminology used to describe, and in some cases advertise Puppy.

Puppy is offered "as is" with no guarantees written or implied, however the stigma of false or deceptive advertising, however innocent, can still have a detrimental affect on the distro.
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#17 Post by HairyWill »

OK, here is another one that helps to illustrate AJs point. The bottom three curves are MemTotal-MemFree-Buffers-Cache, this is basically the minimum amount of memory required for it to work at all. The top three curves are just MemTotal-MemFree and give an indication of how much memory is allocated. My system has 512MB RAM so the kernel is being lazy about claiming back cache space that might no longer be in use. It is more efficient on processor cycles not to worry about claiming back cache space if it is not needed for something else.

The interesting point about the top curves is that after 70 seconds they show about 70MB of space still allocated to cache even though all the programs have long been killed. This space could be recovered if it was needed. My complete guess is that the space recovered when the programs are killed is clean and stale whereas the cache not recovered is dirty.
[edit]Reconsidering this, it might make more sense for the OS to clean up the dirty cache whilst its processor load is low. Recovering clean cache isn't so critical as it is very cheap to recover when and if it is needed[/edit]

Image

Lots of ram and a slow processor allows cache space to be left allocated just in case it might be needed again (this is the reason for puppy's success, a bit of extra ram is generally cheaper than a faster processor)

Very little ram with a fast processor will involve lots and lots of swapping as cache space gets reclaimed aggressively for a higher priority process. Data may have to be reloaded from disk many times in order for a process to complete. The speed of access to your disk will be important here.

Very little ram and a slow processor results in your processor spending most of the precious few cycles it has swapping stuff to and from disk and getting very hot!

Terminology
Stale cache, no longer needed.
Clean cache has not been written to since it was loaded and can simply be overwritten if it is not being used.
Dirty cache has been written to since it was loaded and cannot simply be thrown away it must be written back to disk (expensive).

A common misconception is that a deficiency in RAM can be completely overcome by creating some swap space, partition or file on disk. The problem with this is that disk space is still on disk and has comparatively low access times. The good side of swap space is that it is cheap to have lots of it so the kernel does not have to spend a lot of time managing it and can be lazy about reclaiming stale space.

It is generally a bad idea to have significantly more swap space than ram. This stops the kernel from being so careful about managing its space allocation and can can result in a lot of cycles being used up swapping stuff to and from disk.

My second year operating systems lecturer would be proud. Some of this stuff has stayed in my head for 6 years. I'm afraid I can't warrant for its accuracy though.
Last edited by HairyWill on Wed 19 Dec 2007, 23:46, edited 1 time in total.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#18 Post by 8-bit »

HarryWill,
That was a very good presentation. And this 59 year old dog agrees with you.
AlienJeff, I was just making a point of puppy being able to even boot to desktop on that low memory machine.
I fully agree with the views on memory usage.

And I started using computers back in the days of memory being referenced as to how many kilobytes of memory a computer had.
Also, most if not all computers manufactured are not hardwired to be able to access physical memory amounts beyond a certain point.
The processor support for it is there. But the memory addressing support is not.

Sage
Posts: 5536
Joined: Tue 04 Oct 2005, 08:34
Location: GB

#19 Post by Sage »

Thanks for a most instructive exposition, HW. I think, but couldn't be sure that it verifies what I've been finding, and reporting, by experiment. Obviously, as a non-IT person, I was unable to quantify all this but have constantly warned against implementing too much swap, willy nilly.

Since AMD and Intel processors behave rather differently in detail in respect of microcode as well as physical design, location and deployment of on-chip as well as general cache handling, would you care to speculate on whether there might be any significant difference in their behaviour in practice?
Anecdotally and entirely subjectively, I've always found AMD, post-SktA 'faster', or should that be 'better', in a finger-in-wind kind of way. But I don't care for Intel business practices, either, so am hardly an objective judge!?!

setecio
Posts: 326
Joined: Wed 01 Nov 2006, 12:09
Location: UK

#20 Post by setecio »

Very interesting .... I think I might resize my swap partition. :oops:

I went by windoze recommendation of 1.5 to 3 times RAM, with 224 RAM, I created a swap of 600MB.

So what would be a good Swap size guide for Puppy ?

Would it be in the form of RAM + SWAP = certain figure (300 ? 400? ) with a minimum of 128 ? (I've no idea myself)

Post Reply