Memory status on Dashboard [resolved]

This is a little odd. The server I’m running this on is rather short of memory and a little overloaded but it’s going to get replaced before too long, even so though, these figures look odd:

MEMORY:
App Memory: 18520% (red)
Swap: 6752 (red)

The output of /proc/meminfo shows:

[code:1]MemTotal: 1036664 kB
MemFree: 25172 kB
Buffers: 48196 kB
Cached: 778184 kB
SwapCached: 13384 kB
Active: 741988 kB
Inactive: 147212 kB
HighTotal: 131056 kB
HighFree: 476 kB
LowTotal: 905608 kB
LowFree: 24696 kB
SwapTotal: 1954296 kB
SwapFree: 1885152 kB
Dirty: 2084 kB
Writeback: 0 kB
AnonPages: 60528 kB
Mapped: 589280 kB
Slab: 75200 kB
PageTables: 2192 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 2472628 kB
Committed_AS: 553152 kB
VmallocTotal: 114680 kB
VmallocUsed: 2952 kB
VmallocChunk: 111472 kB
[/code:1]

I think there is a bug there. On my install of 2.3beta2 it is reporting the memory in use as the percentage used. eg if 342MB of RAM is in use then it will show 34200%. The disk usage seems to be OK except for a mount point where I see the same issue.

seems to be hit or miss by system, i’m running on a dell poweredge and it’s showing up accurately

[quote=“dirk”]This is a little odd. The server I’m running this on is rather short of memory and a little overloaded but it’s going to get replaced before too long, even so though, these figures look odd:

MEMORY:
App Memory: 18520% (red)
Swap: 6752 (red)

[/quote]

Mine is somewhat strange too —

App Memory: 254.29MB / 2,027.30MB (12705%)

Can’t work it out… (but haven’t tried too hard)… I have no swap in use and physical memory is around 50% utilised.

C.

It looks like the number_format function is confusing the draw_graph function.

I removed the number_format(ing) from line 168 of admin/config.php and it graphs correctly.

If you have > 999MB of RAM then the result will contain a comma ‘,’ – I think this is what confuses it.

Without the number_format being used the graph looks OK but the tool tip is messy with high precision.

I bugged this as #2133.

[code:1]

Changed:

$out .= draw_graph(_(“App Memory”), “MB”, number_format($app_memory/1024,2), number_format($memory[“ram”][“total”]/1024,2));

To:

$out .= draw_graph(_(“App Memory”), “MB”, number_format($app_memory/1024,2), $memory[“ram”][“total”]/1024);
[/code:1]

C.

this should be fixed at this point.