리눅스 캐시 메모리 비우기

Jmnote (토론 | 기여)님의 2018년 3월 21일 (수) 19:20 판 (210.92.40.7(토론)의 편집을 Jmnote bot의 마지막 판으로 되돌림)
리눅스 캐시 메모리 비우기
리눅스 캐시 메모리 줄이기
/proc/sys/vm/drop_caches

1 명령어

  • pagecache 해제
echo 1 > /proc/sys/vm/drop_caches
  • dentries, inodes 해제
echo 2 > /proc/sys/vm/drop_caches
  • pagecache, dentries, inodes 모두 해제
echo 3 > /proc/sys/vm/drop_caches
  • 플러싱하기
sync

2 실행예시

[root@zetawiki ~]# cat /proc/sys/vm/drop_caches
0
→ drop_caches의 기본값은 0 (=캐시 메모리를 drop하지 않음)
[root@zetawiki ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          3881       1183       2698          0        156        617
-/+ buffers/cache:        408       3472
Swap:         6063          0       6063
→ 버퍼 156MB, 캐시 617MB 사용중
[root@zetawiki ~]# echo 3 > /proc/sys/vm/drop_caches
[root@zetawiki ~]# cat /proc/sys/vm/drop_caches
3
→ drop_caches를 3으로 조정 (=pagecache, dentries, inodes 캐시 메모리 영역을 해제)
[root@zetawiki ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          3881        365       3516          0          0         21
-/+ buffers/cache:        342       3538
Swap:         6063          0       6063
→ 버퍼 0MB, 캐시 21MB 로 줄어듦

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}