Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: vinnie on November 30, 2009, 08:57:38 AM
-
What is the command to clear the cache?
On this PC I have 2gb but after a few days of use (and no further installation) the memory is saturated.
tc@box:~$ free
total used free shared buffers
Mem: 2073984 1934264 139720 0 0
Swap: 0 0 0
Total: 2073984 1934264 139720
I believe that free is not true, in fact watching the cache parameter of this other command:
tc@box:~$ cat /proc/meminfo
MemTotal: 2073984 kB
MemFree: 140632 kB
Buffers: 0 kB
Cached: 1774592 kB
SwapCached: 0 kB
Active: 1270808 kB
Inactive: 625756 kB
Active(anon): 1270808 kB
Inactive(anon): 625756 kB
Active(file): 0 kB
Inactive(file): 0 kB
Unevictable: 4 kB
Mlocked: 4 kB
HighTotal: 1186312 kB
HighFree: 56544 kB
LowTotal: 887672 kB
LowFree: 84088 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 121976 kB
Mapped: 35604 kB
Slab: 20868 kB
SReclaimable: 7296 kB
SUnreclaim: 13572 kB
PageTables: 780 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 1036992 kB
Committed_AS: 2065816 kB
VmallocTotal: 122880 kB
VmallocUsed: 1344 kB
VmallocChunk: 120708 kB
DirectMap4k: 8184 kB
DirectMap4M: 901120 kB
-
echo 3 > /proc/sys/vm/drop_caches
-
I must correct, the phenomenon is much more limited than what I did seem.
I delete a bit of stuff.
root@box:~# free
total used free shared buffers
Mem: 2073984 903084 1170900 0 0
Swap: 0 0 0
Total: 2073984 903084 1170900
The space occupied by all directory (except /sys and /proc) is 700 mb, 900-700=200mb.
This 200 mb where they will?
@jason, the commando echo 3... not sort any result.
-
echo 3 > /proc/sys/vm/drop_caches clears pagecache, dentries, and inodes.
The 200mb you have unaccounted for is probably mounted extensions. The 4096 block size save a bit of ram over the 128kb block size, but depending on how many files are in each mounted extension, there is still ram taken up when extensions are mounted and the files in each extension are read to be symlinked.
-
I left out one important detail. Use the "sync" command before flushing the cache.
-
u know everything jason, I only don't understand what's funny in playing farmville.
I never tried
-
Great, now everyone will think that I am playing games instead of uploading their extensions. :) Just kidding. My crops keep dying on me anyway, I don't spend the time with it that it seems to require to keep on top of it.
Actually, it is not that I know much, but I have learned how to find information or solutions. The first seach result of "linux empty cache" in a google had the above mentioned command.
-
The command sync+echo3 work only for "buffer and cache" displayed with "free"
However my program are all installed in ram :)
-
If the programs are loaded to ram, then that explains the ram usage.
-
You might try loading only what you need with symlinked groups. (See load-grp script). Here's what I'm presently using. If I need something from tce_dir, "load ext" loads it in under a second.
Mem: 211336K used, 303948K free, 0K shrd, 19496K buff, 113776K cached
http://forum.tinycorelinux.net/index.php?topic=3404.0
-
Ok, thanks jason and to all :)
Now everythings is crearer