Opened 7 years ago

Closed 6 years ago

#1454 closed defect (fixed)

GETSITEINFO on Linux does not report correctly server memory information

Reported by: gabrimonfa Owned by: brucedechant
Priority: low Milestone: 2.4
Component: Site Service Version: 2.2.0
Severity: trivial Keywords:
Cc: External ID:

Description

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

Change History (4)

comment:1 Changed 7 years ago by tomfukushima

Owner: set to brucedechant

comment:2 Changed 7 years ago by gabrimonfa

Version: 2.2.0

comment:3 Changed 6 years ago by jng

Milestone: 2.4

comment:4 Changed 6 years ago by jng

Resolution: fixed
Status: newclosed

Fixed 2.4 (r6849) and trunk (r6850)

Note: See TracTickets for help on using tickets.