Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: floppy on January 01, 2011, 11:32:46 AM

Title: RAM usage increase; possibility to free it during a session?
Post by: floppy on January 01, 2011, 11:32:46 AM
hello, I discovered that a TCL session start with approx 110 MB usage with top, application links, application wpa_supplicant, udhcpc running (the 110 MB are indicated with top at the left top side "mem"). While I am tipping these lines, the "mem" indicated is 310 MB. What happens here? I s the memory filling up? Is there a possibility to free it? .. or perhaps the pc hardware is defect? It seems to go sometime down, but with a global tendency for growing.
Thanks for any information because I had the impression the pc is quite going slow.
Title: Re: RAM usage increase; possibility to free it during a session?
Post by: thane on January 01, 2011, 01:32:08 PM
I'm shooting in the dark, but any chance it's your browser? Based on posts I've seen here that's often the culprit in excess memory usage (and slow backup). You might want to look through the forums for discussions of this. There are some lightweight browsers and browsers that have been modified to be less heavy in the repository.
Title: Re: RAM usage increase; possibility to free it during a session?
Post by: tinypoodle on January 01, 2011, 03:22:59 PM
That's mem used incl. buffers and cache.
You could free mem by
Code: [Select]
sudo cache-clear
Using the htop extension might give you a better impression of mem usage.
Title: Re: RAM usage increase; possibility to free it during a session?
Post by: floppy on January 02, 2011, 10:18:05 AM
Done. After using firefox, it freed immediatly by approx. 60000kb. Is it not possible to do it by a batch programm every 1/2 h or to have a mechanism for having it done automatically? I am running now with 159012k used, 615548k free, 0k shared, 180k buff, 121088k cached (from 280...k cached).
Title: Re: RAM usage increase; possibility to free it during a session?
Post by: gerald_clark on January 02, 2011, 10:25:06 AM
Unused RAM is wasted RAM,
Linux will use all available RAM for cache, reassiging it to programs as needed.
Title: Re: RAM usage increase; possibility to free it during a session?
Post by: tinypoodle on January 02, 2011, 10:40:04 AM
Be aware that tmpfs also seems to account under cache.
Title: Re: RAM usage increase; possibility to free it during a session?
Post by: maro on January 02, 2011, 02:24:30 PM
... Is it not possible to do it by a batch programm every 1/2 h or to have a mechanism for having it done automatically? ...

Sure if you'd use boot code 'cron' (or if you've forgotten the boot code you could try sudo /etc/init.d/crond start). You'll then have to set up the cron-job for the 'root' user by calling sudo crontab -e and entering
Code: [Select]
15,45 * * * * /usr/sbin/cache-clear
(and as you are in a 'vi' session you'll need to first press 'i' to insert, then enter the line, 'ESC' after you've finished and 'ZZ' or ':wq' to save it all).

This should execute the command at 15 and 45 minutes past the hour, for every hour, and every day and every month (and every day of the week). To find out more about the 'crontab' format I'd suggest to read a man-page (http://linux.die.net/man/5/crontab).
Title: Re: RAM usage increase; possibility to free it during a session?
Post by: roberts on January 02, 2011, 09:34:18 PM
If you forget the boot code, you can always start cron with the Services GUI available from the system menu system tools section.
Title: Re: RAM usage increase; possibility to free it during a session?
Post by: curaga on January 03, 2011, 01:29:03 AM
I agree with gerald_clark, you don't want to empty caches just to feel better with bigger free ram numbers. You'll lose performance that way, and gain nothing really. If any app needs that ram, it is freed automatically from the caches.