리눅스에서 캐쉬메모리 지우기??

강대섭   
   조회 10922   추천 0    

안녕하세요.
리눅스에서 캐쉬메모리를 지우고 싶은데 어떻게 해야하나요?
인터넷검색해보니

Drop Caches

Kernels 2.6.16 and newer provide a mechanism to have the kernel drop the page cache and/or inode and dentry caches on command, which can help free up a lot of memory. Now you can throw away that script that allocated a ton of memory just to get rid of the cache...

To use /proc/sys/vm/drop_caches, just echo a number to it.

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!

이런애기는 있는데 잘 안되네요....
리눅스 버전은 CentOS 4.5
커널버전은 2.6.9-55
짧은글 일수록 신중하게.
몽몽 2009-07
현재의 커널버전은 2.6.9-55
지원하는 커널은 Kernels 2.6.16 and newer

최신 커널로 업그레이드하세요.

메모리에 filesystem buffer 캐싱된거면 sync 명령쓰면 됩니다.
권국봉 2009-07
말씀하신 drop_caches 기능은 좀 위험합니다.

일단 기능으로 나와있기는하나 2.6.23 커널에서 파일 시스템에 여러번 문제가 된적이 있습니다.

제가 찾아본 글에 의하면 개발용으로 사용할 수 있지만 운영용으로는 적합하지 않다는 판단이 듭니다.

참고 하세요. ;
정희섭 2009-07
top 에서 cached 로 잡히는거 말씀하시는거면 지우실 필요가 있나 싶네요???


QnA
제목Page 4160/5730
2014-05   5266103   정은준1
2015-12   1791034   백메가
2018-09   4253   빠시온
2017-06   11371   김건우
2017-07   5360   회원K
2017-07   3198   나우너
2009-01   7820   박진국
2020-05   2324   전진
2021-10   2881   미친감자
2017-03   4440   두cpu
2016-04   9437   김황중
2021-02   2134   SILVERSTAR
2017-06   3626   블랙펄
2017-07   3892   winner712
2017-07   9021   Doker
2017-10   3914   두cpu
2018-03   4624   빠시온
2018-03   3676   민채
2017-03   5243   신계승
2017-07   4033   김현우1
2022-11   2325   새총
2016-07   3641   SlaysD