Linux API/linux
/proc/pid/statm
구차니
2023. 10. 23. 12:21
top 에서 출력되는 메모리 사용량이 어디서 나오나 찾아보는 중인데
일단 proc fs에서 statm 이라는 것을 발견
proc/77145$ cat statm 3178 1312 896 223 0 467 0 |
다만 page 단위라서, top 처럼 byte 단위로 보는건 어디인지 아직 못 찾음.
Table 1-3: Contents of the statm files (as of 2.6.8-rc3) .............................................................................. Field Content size total program size (pages) (same as VmSize in status) resident size of memory portions (pages) (same as VmRSS in status) shared number of pages that are shared (i.e. backed by a file, same as RssFile+RssShmem in status) trs number of pages that are 'code' (not including libs; broken, includes data segment) lrs number of pages of library (always 0 on 2.6) drs number of pages of data/stack (including libs; broken, includes library text) dt number of dirty pages (always 0 on 2.6) |
[링크 : https://stackoverflow.com/questions/60644373/how-do-i-decode-the-output-of-proc-statm]