메모리 모니터링 free

in #memory6 years ago

Linux 에서 메모리 사용량을 확인하기 위해
기본명령어 free 를 알아보겠습니다.

아래의 그림은 색갈별로 보시면 이해 됩니다.

메모리 전체 사이즈는 (buffers/cache:used + free+buffers+cached)

사용메모리 (Used Physical Memory) : buffers/cache:used + buffers + cached ,Mem: used

실제 메모리 사용량 (Actual Used Physical Memory) : total -(free + buffers + cached) , buffers/cache: used

실제 메모리 사용률 : total -(free + buffers + cached) / total , (total - buffer/cashe: free) / total

위의 그림을 보고 설명하겠습니다.

사용메모리 : 1,705,756 (Mem: used)
실제 메모리 사용량 : 1,122,464 ( -/+ buffers/cache)

free 명령의 항목들을 살펴 보겠습니다.

total : Total Physical Memory , used Phsyical Memory + Inactive Phsyyical Memory

used : Used Physical Memory

free : Free Physical Memory

sahred : Memory shared across Multiple Processes

buffers  : Memory used by kernel Buffers cache to speed up disk operation
                        커널에서 사용하고   메모리에 존재하는 데이터 영역중 
                        디스크로 플러시될 데이터 영역 (더티페이지,청크) 
                        주기적으로 bdflus 데몬에 의해서 디스크로 플러시 된다. 

                        더티페이지 크기는 /proc/meminfo의 Dirty 통해 확인 가능
                         sync 명령 실행하면 강제플러시 된다

cached      :  Memory Used by Kernel Cache for faster access
                  커널에서 사용하고  실행중인 프로그램이 메모리 사용영역 ,
                 디스크 캐시 :동일한 데이터를 캐시유지 할 경우 성능에  유리한다. 
                 Page cache , inode,dentry정보 저장 Cached 영역 증가시 
                free 영역 감소 된다.

                 inode 와 dentry 는 빠른 데이터 접근을 위해 필요한 것인데, 
                 커널의 자원할당자 역할을 하는 slab allocator 라는 것에 의해서 저장 된다.
                 cached 영역에서 slab 이 차지하는 영역의 크기는 
                 /proc/meminfo를 통해 확인할 수 있다.

buffers/cache: used :Actual Used Physical Memory
buffers/cache: free :Actual Free Phsyical Memory

Sort:  

Congratulations @jaerakson! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.19
TRX 0.14
JST 0.030
BTC 60122.55
ETH 3199.29
USDT 1.00
SBD 2.43