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) ?

The code in question follows:

#--------------------------------
mythtv/libs/libmyth/util.cpp:
#--------------------------------
#define MB (1024 * 1024)

bool getMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM)
{
#ifdef __linux__
   struct sysinfo sinfo;
   if (sysinfo(&sinfo) == -1)
   {
       VERBOSE(VB_ALL, "sysinfo() error");
       return false;
   }
   else
       totalMB = sinfo.totalram/MB,
       freeMB  = sinfo.freeram/MB,
       totalVM = sinfo.totalswap/MB,
       freeVM  = sinfo.freeswap/MB;

_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to