summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2021-05-28 19:57:48 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2021-05-28 19:57:48 +0200
commitb06ca56790fdda67ad1162a3143b95ad9832057f (patch)
tree2d089cc676b8f1bb3e970e615900fff69bb0618b
parent0682d554f85d9182e5e7f03a504fb768fa88d6d5 (diff)
downloadpsutil-malloc-info.tar.gz
update mallinfo commentsmalloc-info
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
-rw-r--r--psutil/_pslinux.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
index f032ee0d..9ed8a7a3 100644
--- a/psutil/_pslinux.py
+++ b/psutil/_pslinux.py
@@ -200,17 +200,20 @@ pcputimes = namedtuple('pcputimes',
'iowait'])
# psutil.malloc_info() (mallinfo Linux struct)
-pmalloc = namedtuple('pmalloc', [
- 'arena', # non-mmapped space allocated (bytes)
+pmallinfo = namedtuple('pmallinfo', [
+ 'arena', # total non-mmapped space allocated from system (bytes)
'ordblks', # number of free chunks
- 'smblks', # number of free fastbin blocks
+ 'smblks', # the number of fastbin blocks (i.e., small chunks that
+ # have been freed but not use resused or consolidated)
'hblks', # number of mmapped regions
'hblkhd', # space allocated in mmapped regions (bytes)
- 'usmblks', # maximum total allocated space (bytes)
- 'fsmblks', # space in freed fastbin blocks (bytes)
+ 'usmblks', # always 0
+ 'fsmblks', # space held in fastbin blocks (bytes)
'uordblks', # total allocated space (bytes)
'fordblks', # total free space (bytes)
- 'keepcost' # top-most, releasable space (bytes)
+ 'keepcost' # the maximum number of bytes that could ideally be released
+ # back to system via malloc_trim. ("ideally" means that
+ # it ignores page restrictions etc.)
])
@@ -601,7 +604,7 @@ def swap_memory():
def malloc_info():
- return pmalloc(*cext.linux_mallinfo())
+ return pmallinfo(*cext.linux_mallinfo())
# =====================================================================