Index: launcher/HardwareInfo.cpp
--- launcher/HardwareInfo.cpp.orig
+++ launcher/HardwareInfo.cpp
@@ -300,6 +300,8 @@ QString HardwareInfo::cpuInfo()
 
 #if defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
 #include <cstdio>
+#include <sys/sysctl.h>
+#include <uvm/uvmexp.h>
 
 uint64_t HardwareInfo::totalRamMiB()
 {
@@ -308,26 +310,39 @@ uint64_t HardwareInfo::totalRamMiB()
     if (fp != nullptr) {
         if (fgets(buff, 512, fp) != nullptr) {
             std::string str(buff);
-            uint64_t mem = std::stoull(str.substr(12, std::string::npos));
-
-            // transforming kib -> mib
-            return mem / 1024;
+            uint64_t mem = std::stoull(str.substr(11, std::string::npos));
+            pclose(fp);
+            // transforming bytes -> mib
+            return mem / 1024 / 1024;
         }
+        pclose(fp);
     }
 
     return 0;
 }
 
+uint64_t HardwareInfo::availableRamMiB()
+{
+    struct uvmexp uvmexp;
+    int mib[] = { CTL_VM, VM_UVMEXP };
+    size_t size = sizeof(uvmexp);
+    if (sysctl(mib, 2, &uvmexp, &size, nullptr, 0) == 0) {
+        return (static_cast<uint64_t>(uvmexp.free) * static_cast<uint64_t>(uvmexp.pagesize)) / 1024 / 1024;
+    }
+
+    return 0;
+}
+
 #else
 uint64_t HardwareInfo::totalRamMiB()
 {
     return 0;
 }
-#endif
 
 uint64_t HardwareInfo::availableRamMiB()
 {
     return 0;
 }
+#endif
 
 #endif
