mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-30 20:58:09 +03:00
Merge pull request #139 from philips/fix-crasher-in-memory-stats
glances: fix crasher
This commit is contained in:
commit
7579431ce9
@ -728,12 +728,12 @@ class GlancesStats:
|
|||||||
phymem = psutil.virtual_memory()
|
phymem = psutil.virtual_memory()
|
||||||
|
|
||||||
# buffers and cached (Linux, BSD)
|
# buffers and cached (Linux, BSD)
|
||||||
buffers = getattr(phymem, 'buffers', lambda: 0)
|
buffers = getattr(phymem, 'buffers', lambda: 0)()
|
||||||
cached = getattr(phymem, 'cached', lambda: 0)
|
cached = getattr(phymem, 'cached', lambda: 0)()
|
||||||
|
|
||||||
# active and inactive not available on Windows
|
# active and inactive not available on Windows
|
||||||
active = getattr(phymem, 'active', lambda: 0)
|
active = getattr(phymem, 'active', lambda: 0)()
|
||||||
inactive = getattr(phymem, 'inactive', lambda: 0)
|
inactive = getattr(phymem, 'inactive', lambda: 0)()
|
||||||
|
|
||||||
# phymem free and usage
|
# phymem free and usage
|
||||||
total = phymem.total
|
total = phymem.total
|
||||||
|
Loading…
Reference in New Issue
Block a user