[mapguide-trac] #1454: GETSITEINFO on Linux does not report correctly server memory information

MapGuide Open Source trac_mapguide at osgeo.org
Tue Oct 5 06:51:06 EDT 2010


#1454: GETSITEINFO on Linux does not report correctly server memory information
----------------------------+-----------------------------------------------
   Reporter:  gabrimonfa    |       Owner:     
       Type:  defect        |      Status:  new
   Priority:  low           |   Milestone:     
  Component:  Site Service  |     Version:     
   Severity:  trivial       |    Keywords:     
External_id:                |  
----------------------------+-----------------------------------------------
 GETSITEINFO always reports 0 KB server total and available physical memory
 and total and available virtual memory.

 The problem is in MgUtil::GetLinuxMemoryStatus in file
 http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Common/Foundation/System/Util.cpp

 It parses "/proc/meminfo" but it seems to expect that its format is like
 that of "free" command, i.e. 2 lines with the memory amounts.

 On the contrary, /proc/meminfo has one line for each value, and should be
 parsed accordingly,

 864             // Read physical memory info
 ...
 871             fgets(line, 80, meminfo);
 872             sscanf(line, "%*4s %lf %lf %lf %lf %lf %lf",
 873                 &total, &used, &free, &shared, &buffers, &cached);
 ...
 882             // Read swap memory info
 883             double swapTotal;
 884             double swapUsed;
 885             double swapFree;
 886             fgets(line, 80, meminfo);
 887             sscanf(line, "%*5s %lf %lf %lf",
 888                 &swapTotal, &swapUsed, &swapFree);

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1454>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list