[PATCH] physical memory size computing error
There are two minor bugs on physical memory size computing: (1) fromunits() returns wrong value for "2001844kB", which consists of more than one digits. (2) memory()['memtotal'] is in kB. If "--realmem" is not provided at CLI, totalmem() returns number in MB and the "firmware/hardware" amount will be minus. totalmem() needs to always return value in kB. Here is how to test this patch: (1) Do "smem -w" , the "firmware/hardware" amount should not be minus. (2) Do "smem -w -R 2001844kB" (change 2001844kB per your PC, note to keep it in kB unit) , the "firmware/hardware" amount should not be minus. Here's a patch to fix these issues.
This commit is contained in:
parent
52848c0efb
commit
4865bf2967
1 changed files with 1 additions and 1 deletions
2
smem
2
smem
|
|
@ -77,7 +77,7 @@ def totalmem():
|
|||
_totalmem = fromunits(options.realmem)
|
||||
else:
|
||||
_totalmem = memory()['memtotal']
|
||||
return _totalmem / 1024
|
||||
return _totalmem
|
||||
|
||||
_kernelsize = 0
|
||||
def kernelsize():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue