I am trying to use QProcess to get the memory, I'm using RedHat 7.3, if I open a terminal and type free, this gives me:
total used free shared buff/cache available
Mem: 7865728 1602988 3984928 297040 2277812 5552268
Swap: 8126460 0 8126460
I've tried to produce the same in QT:
QProcess p;
p.start("free");
p.waitForFinished();
QString strMemory = p.readAllStandardOutput();
qDebug() << strMemory;
p.close();
However this doesn't work and my application hangs, I've also tried:
sh free
No better.