Started workin on stuff
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
33cf7066b4
commit
a0e7729aa6
28 changed files with 908 additions and 247 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <QDebug>
|
||||
#include <QString>
|
||||
#include "sys.h"
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
@ -7,9 +8,6 @@
|
|||
#include <QMap>
|
||||
#include <QProcess>
|
||||
#include <QStandardPaths>
|
||||
#include "Application.h"
|
||||
#include "Commandline.h"
|
||||
#include "java/JavaUtils.h"
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
bool rosettaDetect()
|
||||
|
@ -59,4 +57,18 @@ QString useQTForArch()
|
|||
#endif
|
||||
return qtArch;
|
||||
}
|
||||
|
||||
int suitableMaxMem()
|
||||
{
|
||||
float totalRAM = (float)Sys::getSystemRam() / (float)Sys::mebibyte;
|
||||
int maxMemoryAlloc;
|
||||
|
||||
// If totalRAM < 6GB, use (totalRAM / 1.5), else 4GB
|
||||
if (totalRAM < (4096 * 1.5))
|
||||
maxMemoryAlloc = (int)(totalRAM / 1.5);
|
||||
else
|
||||
maxMemoryAlloc = 4096;
|
||||
|
||||
return maxMemoryAlloc;
|
||||
}
|
||||
} // namespace SysInfo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue