[mythtv] system status reports wrong sizes
Nigel Pearson
nigel at ind.tansu.com.au
Fri Feb 18 04:58:09 UTC 2005
> I've noticed a number of times that whenever I would check out the
> "System Status" section of the frontend, that it always reported a very
> low number for my swap space. I looked into it enough to ask the
> following question:
>
> Shouldn't the "getMemStats ()" method in "libs/libmyth/util.cpp" use
> the
> "sinfo.mem_unit" field to determine the sizing of all other values in
> sinfo
> before it simply divides everything by the macro "MB" (1024 * 1024) ?
Indeed it should.
I didn't realise that there was a "units" field when I reviewed
Tommy's code - I think I was looking at a sysinfo manpage that lists
the 2.3.16 version of struct sysinfo first, and didn't read further :-(
How about this:
totalMB = sinfo.totalram / (MB/sinfo.mem_unit),
freeMB = sinfo.freeram / (MB/sinfo.mem_unit),
totalVM = sinfo.totalswap / (MB/sinfo.mem_unit),
freeVM = sinfo.freeswap / (MB/sinfo.mem_unit);
(although sinfo.totalram*sinfo.mem_unit/MB is probably more intuitive?)
--
Nigel Pearson, nigel at ind.tansu.com.au | "Now the world has gone to bed,
Telstra BI&D, Sydney, Australia | Darkness won't engulf my head,
Office: 8255 4222 Fax: 8255 3153 | I can see by infrared,
Mobile: 0408 664435 Home: 9792 6998 | How I hate the night." -Marvin
More information about the mythtv-dev
mailing list