본문 바로가기

메모리 캐쉬 삭제

MintState 2011년 1월 28일 오전 1:40 조회 18809

리눅스에 메모리가 꽉차 캐쉬를 지우고 싶을때 리부팅하지 않고 캐쉬를 지울수 있다.

우선 메모리 확인 -m은 메가바이트 단위로 보여준다.
# free -m

[Attach]592[/Attach]

그럼 캐쉬 삭제는 echo 명령어를 사용하면 된다.
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 in order to make sure all cached objects are freed.

첨부파일

  • 14KB
공유 X Facebook LINE QR 코드

댓글 0개

첫 댓글을 남겨보세요.