From b06ca56790fdda67ad1162a3143b95ad9832057f Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Fri, 28 May 2021 19:57:48 +0200 Subject: update mallinfo comments Signed-off-by: Giampaolo Rodola --- psutil/_pslinux.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'psutil/_pslinux.py') 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()) # ===================================================================== -- cgit v1.2.1