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

강대섭   
   조회 10887   추천 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 4153/5724
2015-12   1762989   백메가
2014-05   5237321   정은준1
2009-07   8235   정의한
2009-07   30172   정의한
2009-07   7734   김상우AP
2009-07   7939   x105
2009-07   6402   김상일
2009-07   8564   보슬비내리…
2009-07   7250   김주용s
2009-07   6711   김주용s
2009-07   9622   김지영
2009-07   14290   윤치열
2009-07   8737   푸릉이
2009-07   7096   허원
2009-07   6417   김동주
2009-07   6837   푸릉이
2009-07   19026   푸릉이
2009-07   6519   김건우
2009-07   10888   강대섭
2009-07   11208   김두홍
2009-07   6498   도석림l지나가는바람처럼
2009-07   7524   푸릉이