Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: cURIOUSgEORGE on May 26, 2011, 08:43:50 PM

Title: Trying to free up ram (SOLVED)!
Post by: cURIOUSgEORGE on May 26, 2011, 08:43:50 PM
 I just tried to move some tce's to On-Demand too save more ram...........

I had everything in On-Boot with control panel system stats telling me that I have 192000kb of free ram

soo, I move about 5 items to On-Demand and rebooted then immediately checked system stats free ram and see that it says 5000kb left of free ram..........

How does that even make any sense! ?

And on TOP OF ALL OF THAT "I THEN MOVED EVERYTHING BACK TOO HOW IT ORIGINALLY WAS (On-Boot) AND NOW IT SAYS I HAVE 35000KB of free ram!

Haha, whoaaaaaaaa, what's going on here? Am I missing something ?

Educate me, Thanks George
Title: Re: What the hell is going on?
Post by: cURIOUSgEORGE on May 26, 2011, 09:41:59 PM
 Read this and as confused as I am ???

Comon now, bring out the big guns........

Curaga

TinyPoodle

Gerald Clark

Or anybody else that has a clue........

Thanks, George
Title: about measuring memory usage
Post by: tinypoodle on May 26, 2011, 09:47:27 PM
Do
Code: [Select]
sudo cache-clearbefore measuring free mem.
Title: Re: What the hell is going on?
Post by: cURIOUSgEORGE on May 26, 2011, 09:52:25 PM
 TinyPoodle YOU SCARE THE SHIT OUT OF ME (You know too much) hahaha

Thank you VERY much, that worked!

I wonder why it didn't work just by simply shutting down and rebooting.

Anyways, I'm happy, soo thank you.
Title: Re: What the hell is going on?
Post by: cURIOUSgEORGE on May 26, 2011, 10:50:45 PM
 Okay, like I said that did work but................

 Now, after I reboot I'm noticing that everything is ****** up again,hmmmm
It's still seeing the "incorrect" amount of (MemFree and Committed_AS) :'(

Do I have to run the command (sudo cache-clear) every time that I want to see accurate results? Or is there another solution ?

and also when I do run (sudo cache-clear) ------> Why doesn't it change the (committed_AS) ?


Thanks, George
Title: Re: What the hell is going on?
Post by: gerald_clark on May 26, 2011, 10:54:16 PM
The system will use all available memory as cache, releasing it as needed.
Either run cache-clear before running 'free' or add up the free and cache values.
Title: Re: What the hell is going on?
Post by: cURIOUSgEORGE on May 26, 2011, 11:02:08 PM
 Hmmmmmmmmmmm, "That's some mickey mouse shit right there."

 As much as I love TC/MC more then anything, it just doesn't seem proper - to have to do that.

hmmm
Title: Re: What the hell is going on?
Post by: gerald_clark on May 26, 2011, 11:22:53 PM
You don't "have" to do anything.
Just ignore the memory figures and run your applications.
This is not a Tiny Core issue.  All Linux work this way.
Title: Re: What the hell is going on?
Post by: cURIOUSgEORGE on May 26, 2011, 11:29:54 PM
 Gerald, I know that I don't "have" too but, if I want to see accurate results then I "have" too.

You are right though, just ignore it because I know the truth is that I have more available ram then it's actually showing, and ignoring it is what  I will do..... "no biggie" , just sucks a little bit but it is what it is and thanks for your help once again.
Title: about measuring memory usage
Post by: tinypoodle on May 27, 2011, 02:00:48 AM
and also when I do run (sudo cache-clear) ------> Why doesn't it change the (committed_AS) ?

Where exactly is that?
Title: Re: What the hell is going on?
Post by: cURIOUSgEORGE on May 27, 2011, 05:53:53 AM
From the control Panel and then click on system stats then click MEM.
Title: about measuring memory usage
Post by: tinypoodle on May 27, 2011, 07:36:20 AM
Found same in meanwhile with
Code: [Select]
cat /proc/meminfo
Not sure of what relevance it would be though.   ???
Title: about measuring memory usage
Post by: tinypoodle on May 27, 2011, 08:58:00 PM
The system will use all available memory as cache, releasing it as needed.
Either run cache-clear before running 'free' or add up the free and cache values.

Running cache-clear would not exclude non-droppable cache as opposed to subtracting.
I am under the impression that the part of tmpfs which resides in RAM is accounted as cache, which is not unsignificant with TC in particular.
Title: Re: about measuring memory usage
Post by: Rich on May 28, 2011, 03:57:05 AM
Hi cURIOUSgEORGE
I've seen the subject of concern over free memory come up a couple of times before. One of the
design philosophies of the memory manager is that "unused memory is wasted memory". As a result,
when you closed a program it stays in memory so that it will start quicker if you decide to run it again.
Now when you start a program that requires more memory than is free, the memory manager looks
through the memory for sections that are not part of running programs and starts freeing up the oldest
pieces of memory for the program you are starting. This is a simplistic explanation but it gives you the
basic idea. So unless you are having problems, a low number for free RAM means the memory
manager is doing it's job. I've also seen it suggested to run cache-clear periodically in the background
to boost the reported amount of free memory, this is a bad idea. To demonstrate, the program I am
currently working on takes 2 seconds to compile. After running cache-clear it takes 10 seconds to
compile, and if I compile it again it's back to 2 seconds. It runs faster because the memory manager
is keeping the most recently used data in RAM. When you are done reading this would you please go
to your first post, click on edit, and change the title to something relating to the subject, for example,
"Trying to free up RAM" or "Why do I have so little free RAM" or something else appropriate.
Title: Re: What the hell is going on?
Post by: vinnie on May 28, 2011, 06:11:20 AM
thanks for clarity, hiro, this is interesting
Title: about measuring memory usage
Post by: tinypoodle on May 28, 2011, 09:37:45 AM
I've also seen it suggested to run cache-clear periodically in the background
to boost the reported amount of free memory, this is a bad idea.

Depends on setup, while running in default mode I wouldn't note any difference in performance.

Quote
When you are done reading this would you please go
to your first post, click on edit, and change the title to something relating to the subject, for example,
"Trying to free up RAM" or "Why do I have so little free RAM" or something else appropriate.

+1
Shift rant from topic into post, if you must...   :P
Title: Re: about measuring memory usage
Post by: Rich on May 28, 2011, 12:33:10 PM
I stand by my statement.
Title: Re: About Measuring Memory Usage.
Post by: glene77is on May 28, 2011, 08:53:49 PM
One of the design philosophies of the memory manager
is that "unused memory is wasted memory".

Rich,
It is INDEED a "design philosophy of memory management".    
My first computer, AIM-65 had 4 KB of RAM, and I had to design/build a 32 KB RAM board for development, in assembler, of motor controls.  
My Altair 8000, S-50 buss, had 8" floppies, and a 16 KB Ram Board.
My Apple II had 16 KB RAM, extended by a 48 KB board.
My Apple II, running a Z80 card, and CP/M, wanted a 64 KB RamCard, so I built one.
My IBM-PC wanted extended memory, then expanded memory.  
They all needed a Swap File, Paged-in binary modules, Layered-modules, etc.
We all have Swap files and Swap partitions to handle over-flow, out-flow, retrievable-flow, etc.
It is INDEED a "design philosophy of memory management" and a real necessity.  
    
Thanks for the reminder, :)
glene77is
Title: Re: about measuring memory usage
Post by: Rich on May 28, 2011, 11:54:53 PM
Hi glene77is
A yes, 8" floppies, that brings back memories. Ever see what happens when you put a hard sectored
disk in a soft sectored drive?
Title: about measuring memory usage
Post by: tinypoodle on May 29, 2011, 12:00:53 AM
Umm, removing a word from topic was not the issue, but giving it a title reflecting the content of the thread for future reference...   ::)
Title: Re: about measuring memory usage
Post by: glene77is on May 29, 2011, 07:48:04 AM
Umm, removing a word from topic was not the issue, but giving it a title reflecting the content of the thread for future reference...   ::)

Tiny,
Right on.  :)
The title does not contain relevant "categorical" data for future searches.
glene77is
Title: Re: about measuring memory usage
Post by: tinypoodle on May 29, 2011, 11:41:18 AM
Umm, removing a word from topic was not the issue, but giving it a title reflecting the content of the thread for future reference...   ::)

Tiny,
Right on.  :)
The title does not contain relevant "categorical" data for future searches.
glene77is

Well, I changed the subject line of all my post in this thread, because that is what I can do...
Title: Re: about measuring memory usage
Post by: Rich on May 29, 2011, 12:09:08 PM
Ditto.
Title: Re: Trying to free up ram
Post by: cURIOUSgEORGE on July 05, 2011, 08:03:02 AM
 After deleteing everything in mydata.tgz and rebooting "with the backup option" the committed_as is back to normal "HELL YEAH"!!! I don't understand why nobody understood what I was talking about...... After uninstalling a program the committed_as should go down NOT KEEP BUILDING because that's how LINUX WAS DESIGNED! Wouldn't make any sense. 8)

The system went from 400000kb committed_as to now 74000kb on system start.
Title: Re: Trying to free up ram (SOLVED)!
Post by: curaga on July 05, 2011, 08:16:56 AM
http://www.redhat.com/advice/tips/meminfo.html
Quote
The Committed_AS is a guesstimate of how much RAM/swap you would need worst-case.

committed_as does not measure real memory.
Title: Re: Trying to free up ram (SOLVED)!
Post by: cURIOUSgEORGE on July 05, 2011, 08:27:26 AM
Committed_AS: An estimate of how much RAM you would need to make a 99.99% guarantee that there never is OOM (out of memory) for this workload. Normally the kernel will overcommit memory. That means, say you do a 1GB malloc, nothing happens, really. Only when you start USING that malloc memory you will get real memory on demand, and just as much as you use. So you sort of take a mortgage and hope the bank doesn't go bust. Other cases might include when you mmap a file that's shared only when you write to it and you get a private copy of that data. While it normally is shared between processes. The Committed_AS is a guesstimate of how much RAM/swap you would need worst-case.


Yes BUT where's it getting it's bright idea of it's "guesstimate"? From all of the programs installed, right? Basically?

Well, when I uninstalled many programs the committed_as was still growing "as if they where still there"!

That was my whole point.
Title: Re: Trying to free up ram (SOLVED)!
Post by: netnomad on July 05, 2011, 08:30:25 AM
by the way,
although there are so many interesting things to know about mem, swap and so on,
you could use just a script that frees unused stuff.

i use it f.e. when i work on a large grafic-file with gimp and my 1GB of ram is not enough and my system begins to swap.
at the same time it's getting slow to work, and the swap is also not freed after i close that file.
and the systems remains slow afterwards, too...

#! /bin/sh
su -c "sync; echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a"

i use this script now for a couple of months on different platforms and it just works.
Title: Re: Trying to free up ram (SOLVED)!
Post by: cURIOUSgEORGE on July 05, 2011, 09:13:52 AM
@netnomad , sounds like a very good idea and I'll try that out if ever needed. ;) As of now my system is running excellent.
Thanks for the tip though.