Comment 1 for bug 1185508

Revision history for this message
Daniel Manrique (roadmr) wrote :

The parser (checkbox/parsers/meminfo.py) multiplies the number taken from /proc/meminfo by 1024; thus, the parser returns *bytes* and not kB:

meminfo[key] = int(integer) * 1024

Then, the memory_compare script considers this is in kB already, hence the mismatch; we're off by a factor of 2^10:

print("\t/proc/meminfo reports:\t%s kB" % visible_memory, file=sys.stderr)

The dmi parser does the same, here's an instance of a memory module with the size reported in bytes:

path: /devices/virtual/dmi/id/device
category: DEVICE
vendor: Samsung
serial: 96FC8ED6
size: 2147483648
form: SODIMM

So at least memory_compare is comparing apples to apples, even if our apples' size is off by 1024 (yum, a 300-kg apple).

I think this just needs fixing the display in memory_compare script. I'd vote for displaying sizes in MB (those large kB numbers are awfully hard to visually parse), or maybe being smart enough to choose an appropriate unit (for this system with 132 GB, the numbers will also be somewhat awkward).