Joined: 24 Aug 2009 Posts: 2070 Location: South Florida
Posted: Wed May 04, 2011 16:41 Post subject: Script to clear swap and free memory...opinions
After reading heavily on how kernel 2.6 manages memory, buffers and swaps, I stumbled upon this link where a user has implemented a simple bash script and has added it to his cronjobs:
I am a heavy user of Samba and other memory intensive applications. Aside from a reboot, the used RAM always stays in the cache and is never freed.
Would running a cronjob like the example listed above, say every 12 hours (and at like 3 A.M) be a wise idea?
I can certainly understand that it could cause major issues if an application was running (say a user D/Ling from my FTP), so I am asking for your opinions.
Thanks,
Masterman _________________ Optware, the Right Way
Asus RT-AC68U
Asus RT-N66U
Asus RT-N10
Asus RT-N12
Asus RT-N16 x5
Asus WL520gU
Engenious ECB350
Linksys WRT600Nv1.1
Linksys WRT610Nv1
Linksys E2000
Netgear WNDR3300
SonicWall NSA220W
SonicWall TZ215W
SonicWall TZ205W
SonicWall TZ105W
Posted: Thu May 05, 2011 8:32 Post subject: Re: Script to clear swap and free memory...opinions
Masterman wrote:
I am a heavy user of Samba and other memory intensive applications. Aside from a reboot, the used RAM always stays in the cache and is never freed.
Sure, because free memory is useless memory.
Quote:
Would running a cronjob like the example listed above, say every 12 hours (and at like 3 A.M) be a wise idea?
Probably not. If you have the feeling that your system uses to much ram for caches you can adjust the vm.vfs_cache_pressure sysctl, but looking at your # free "screenshot" that's not the case. _________________ Router: WNDR3300 (wl0: n-Only 5Ghz, WPA2-AES, wl1: g-Only, WPA-Mixed-Mixed)
WDS Node 1: WNDR3300 (wl0: n-Only 5Ghz, WPA2-AES, WDS-connected Router, wl1: g-Only WPA-Mixed-Mixed)
WDS Node 2: WRT54GL (g-Only, WPA-Mixed-Mixed WDS-connected to Router)
Modem: Cisco EPC3202
clients: Notebook 1, D-Link 323, PS3 Slim, Kathrein UFC960 connected to WDS Node 1 via Gigabit Switch. Notebook 2, Deskjet 6980 connected to WDS Node 2
My free RAM is slowly being increased _________________ Optware, the Right Way
Asus RT-AC68U
Asus RT-N66U
Asus RT-N10
Asus RT-N12
Asus RT-N16 x5
Asus WL520gU
Engenious ECB350
Linksys WRT600Nv1.1
Linksys WRT610Nv1
Linksys E2000
Netgear WNDR3300
SonicWall NSA220W
SonicWall TZ215W
SonicWall TZ205W
SonicWall TZ105W
i doubt it will help you in any way, but if so i'd be glad to hear. _________________ Router: WNDR3300 (wl0: n-Only 5Ghz, WPA2-AES, wl1: g-Only, WPA-Mixed-Mixed)
WDS Node 1: WNDR3300 (wl0: n-Only 5Ghz, WPA2-AES, WDS-connected Router, wl1: g-Only WPA-Mixed-Mixed)
WDS Node 2: WRT54GL (g-Only, WPA-Mixed-Mixed WDS-connected to Router)
Modem: Cisco EPC3202
clients: Notebook 1, D-Link 323, PS3 Slim, Kathrein UFC960 connected to WDS Node 1 via Gigabit Switch. Notebook 2, Deskjet 6980 connected to WDS Node 2