2014-03-26 51 views
3

當我爲其中一個進程運行memps命令時,會得到以下行(等等)作爲輸出。[heap]或[anon]在memps輸出中意味着什麼

S(CODE) S(DATA) P(CODE) P(DATA) 3D(RSS) 3D(PSS) ADDR(start-end)OBJECT NAME 
-------- -------- -------- -------- ------- --------- ----------------------------- 
     0  0  0  1592  0  0 b8ca6000-b8e54000 [heap] 
     0  404  0  404  0  0 b8bdc000-b8ca6000 [heap] 
     0  0  0  4  0  0 b6fb5000-b6fb6000 [anon] 
     0  0  0  20  0  0 b6fb0000-b6fb5000 [anon] 

[heap]和[anon]在我輸出的最後一列是什麼意思。

+0

你知道當你用C++中的'new'分配內存嗎(或者C語言中的'malloc')嗎?這是來自*堆*。 –

回答

5
  o Anonymous memory: Memory not relating to any 
      named object or file within the file system is 
      reported as [ anon ]. 

      The pmap command displays common names for cer- 
      tain known anonymous memory mappings, such as: 

      [ heap ] 
        The process heap. 

      [ stack ] 
        The process stack. 

      If the common name for the mapping is unknown, 
      pmap displays [ anon ] as the mapping name. 

source

還有2個PDF文件here

你或許應該使用這種更寬泛的關鍵字,因爲你正在使用的工具是隻是一個memtool的一部分套房。 下一次嘗試類似「memtool anon」作爲您搜索的關鍵字。