Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Oct 2014, 19:23
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How much RAM is your Puppy using?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
Bruce B


Joined: 18 May 2005
Posts: 11130
Location: The Peoples Republic of California

PostPosted: Sat 06 Sep 2008, 06:10    Post subject:  How much RAM is your Puppy using?
Subject description: how can you know? -> how you can know
 

How can you know? -> how you can know
(or at least get closer readings)


I think we have software very serious about doing things, which in
Puppy, can lead to artificially high RAM usage reports when using
BusyBox Free.

1) Linux is serious about using RAM and keeping things in cache.

2) BusyBox Free command is serious about never factoring the
caches when it reports used memory.

The text file attached to this post is designed to be converted to a
script, after you read it.

This is what the script does:

* displays free report
* drops cache from RAM
* displays free report

Result

Beside freeing RAM, which you may want to do anyway, it gives
you a report much closer to actual RAM usage, by dropping
the caches, then reading the memory usage. The two reports,
(before and after), display on screen and you can see the
differences.

-----------

The script has been tested throughly on Dingo 4.00 only, by me,
before submission. It requires kernel version 2.6.16 or newer.

Enjoy, and use at your own risk.

--------------

Attachment is deleted. The entire propose of my post, the how-to is clearly not understood. Not being a professional author, it's as good as I can do and it's all I'm willing to do.


Sorry.

Last edited by Bruce B on Sun 07 Sep 2008, 12:38; edited 1 time in total
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11130
Location: The Peoples Republic of California

PostPosted: Sat 06 Sep 2008, 12:21    Post subject:  

Here is an output sample from freemem

Code:
{~} freemem

Before dropping caches

              total         used         free       shared      buffers
  Mem:       126056       112836        13220            0         2044
 Swap:       102392            0       102392
Total:       228448       112836       115612

After dropping caches

              total         used         free       shared      buffers
  Mem:       126056        78424        47632            0           60
 Swap:       102392            0       102392
Total:       228448        78424       150024

{~}
Back to top
View user's profile Send private message 
linuxcbon

Joined: 09 Aug 2007
Posts: 762

PostPosted: Sun 07 Sep 2008, 07:53    Post subject:  

I tried it too.
Can you explain what it does, where do you get that from, and why it is not done by the kernel ?
I read somewhere, it is not a good thing to do.
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11130
Location: The Peoples Republic of California

PostPosted: Sun 07 Sep 2008, 11:27    Post subject:  

Sure, the answers are in the file with specificity.
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2258

PostPosted: Sun 07 Sep 2008, 12:27    Post subject:  

Cached pages are free -that is they are available for use. Manually manipulating the Cache would rarely be good idea -the kernels management is superb. Folks who are recently-converted from windows are often concerned about Linux's high usage of RAM. But this is normal and as it should be. the kernel retains pages in the cache until it really needs to space -this avoids expensive writes to swap space -expensive both in terms of disk life and CPU cycles.
You can simply subtract the cached size from the output of the free program in order to get a better idea of the total amount of RAM available.
That said, congrats on a possibly-useful utility for some occasions if the user heeds the advice about running sync first.
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2258

PostPosted: Sun 07 Sep 2008, 12:27    Post subject:  

Cached pages are free -that is they are available for use. Manually manipulating the Cache would rarely be good idea -the kernels management is superb. Folks who are recently-converted from windows are often concerned about Linux's high usage of RAM. But this is normal and as it should be. the kernel retains pages in the cache until it really needs to space -this avoids expensive writes to swap space -expensive both in terms of disk life and CPU cycles.
You can simply subtract the cached size from the output of the free program in order to get a better idea of the total amount of RAM available.
That said, congrats on a possibly-useful utility for some occasions if the user heeds the advice about running sync first.
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11130
Location: The Peoples Republic of California

PostPosted: Sun 07 Sep 2008, 12:34    Post subject:  

This is not what I wanted. The only way I could think of is to make it a non executable text download with a txt extension - for the purpose that people would read it. Credits, reference, explanation everything.

The only thing I didn't say with specificity is the sentence below. It must have seemed too 101 for me to mention it or consider it.

Caching is a good thing to do, especially when it is done as well as the Linux Kernel

The reason why it is good is; RAM is fast and by caching, it saves the workload of excessive re-reading same data. The fundamental principle is; if the computer read data from disk to RAM one time, it's likely to read the same data again. If you have RAM to spare, by caching data, it should, increase speed and efficiency. It is not perfect math because, maybe your computer will read a specific application one time, or perform a function in a session and that won't ever be used again. The computer can't predict what you will do in the future.

It may cache data, it won't use again. But even this, is not a problem. The reason why, is because it will drop the data from cache to make room for a new processes. In other words, it's all very fluid, the OS is not married to its caches. It just tries to make things faster and more efficient by maintaining caches in RAM. In the case of Linux, it likes to keep lots of cache.

-----------------

Amigo of course the script syncs - you did read it before the commenting didn't you?


The only purpose in my taking the time to share this script with all the remarks and references is helping you guys get accurate memory read information.

My purpose is not to reduce ram caching, this is not implied. That was the best I know how to communicate - cannot do better than that.
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11130
Location: The Peoples Republic of California

PostPosted: Sun 07 Sep 2008, 13:56    Post subject:  

linuxcbon wrote:
I tried it too.
Can you explain what it does, where do you get that from, and why it is not done by the kernel ?
I read somewhere, it is not a good thing to do.


Although the purpose of my post was missed. I wish to refute what
you read somewhere.

I read somewhere that it's a non destructive thing to do. In different
words - no harm in doing it.

If this were a debate this would put us even. We both read
something somewhere.

What we read has different implications.

What distribution I discovered using was acknowledged in the text
file you read.

Andrew Morton the kernel maintainer published it and the
publication has circulated.

It was published (signed off by him?) on 2005-12-22

The feature seems to have been implemented, after signing it off,
and implemented in version 2.6.16, and later, as mentioned in the
parent.

I won't post the code, but will publish the bash instructions and
comments for anyone who wish to make their own script.

Code:
+ drop_caches
+ -----------
+
+ Writing to this will cause the kernel to drop
+ clean caches, dentries and
+ inodes from memory, causing that memory to become free.
+
+ To free pagecache:
+   echo 1 > /proc/sys/vm/drop_caches
+ To free dentries and inodes:
+   echo 2 > /proc/sys/vm/drop_caches
+ To free pagecache, dentries and inodes:
+   echo 3 > /proc/sys/vm/drop_caches
+
+ As this is a non-destructive operation and
+ dirty objects are not freeable, the
+ user should run `sync' first.
+
+
+  2.5 /proc/sys/dev - Device specific parameters



The bulk of this, was also in the text file. Please note the THE kernel
maintainer's post does say it is a non-destructive operation.

If we have a discrepancy about what we read. Considering my
source and specificity involved. I want to indicate that I do refute
your source, based on my source. If your source tends to imply
that by 'not being a good thing to do' it is a 'bad thing to do'. I'd like
you to provide the source.

Kernel.org
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11130
Location: The Peoples Republic of California

PostPosted: Sun 07 Sep 2008, 15:51    Post subject:  

amigo wrote:

That said, congrats on a possibly-useful utility for some occasions if the user heeds the advice about running sync first.


I totally do not follow your advice at all!

Neither the reason or logic if there is any!

This is over the top and out reality. I didn't at any point advise the
user run sync first. For anyone who downloaded it. I do not advise running sync first. I see no need.

Code:
sync && echo 3 > /proc/sys/vm/drop_caches


Well for anyone who knows how to read code, they can decide the
need for running sync first.

Amigo as the person asserting a need to follow his advice on how
to run the script can explain his reasoning, if there is any at all.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0725s ][ Queries: 12 (0.0041s) ][ GZIP on ]