블로그 이미지
Rootrator
1개를 알면 모르는 10개가 튀어나온다..!

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

2015. 7. 28. 17:20 Linux

byte 로 확인

ps aux | grep 프로세스명 | awk '{print $6}' | awk '{total = total + $1} END {print total}'


Mysql 메모리 상태 

[root@test ~]# ps aux | grep mysql | awk '{ print $6 }' | awk '{total = total + $1} END { print total}'

366776


Mbyte로 확인

ps aux | grep 프로세스명 | awk '{print $6}' | awk '{total = total + $1} END {print total/1024}'


[root@test ~]# ps aux | grep mysql | awk '{ print $6 }' | awk '{total = total + $1} END { print total/1024}'

358.191


리눅스든 윈도우든 유휴 메모리를 캐쉬로 잡아두기 때문에 캐시영역의 메모리도 같이 봐야


실제 메모리 사용량을 알수 있다.


[root@test ~]# free -m

             total       used       free     shared    buffers     cached

Mem:          7842       3920       3921          0        582       1820

-/+ buffers/cache:       1517       6325

Swap:         4095         36       4059



명목 여유 메모리는 3921

실질 여유 메로리는 6325(3921 + 582 + 1820)(근사치이다)




반응형
posted by Rootrator