Commit b854f06c authored by Jan Möbius's avatar Jan Möbius

Merge branch 'fixMemInfoOSX' into 'master'

fixes #32 by applying the patch provided by a dielen.

ps: i am still missing around 700 mb mrmory from the provided information, but this is better than before

See merge request !69
parents 25dfd35c db2ac542
......@@ -40,6 +40,8 @@
\*===========================================================================*/
#include "RAMInfo.hh"
#include <QString>
#include <stdio.h>
// Main Memory information
......@@ -133,10 +135,9 @@ namespace Utils
physical_memory = 0;
}
// retrieve free memory
double total = vmstat.wire_count + vmstat.active_count + vmstat.inactive_count + vmstat.free_count;
double free = vmstat.free_count / total;
_outMemoryVacancy.totalRamMB = physical_memory / 1024 / 1024;
_outMemoryVacancy.freeRamMB = (long)(free + vmstat.inactive_count) * PAGE_SIZE / 1024/1024;
unsigned long active = vmstat.active_count * PAGE_SIZE / 1024 / 1024;
_outMemoryVacancy.freeRamMB = _outMemoryVacancy.totalRamMB - active;
_outMemoryVacancy.bufferRamMB =0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment