Started workin on stuff

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2024-01-24 18:26:43 +02:00
parent 33cf7066b4
commit a0e7729aa6
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
28 changed files with 908 additions and 247 deletions

View file

@ -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