Make it 1.5 since we have some swap to work with

This commit is contained in:
Girish Ramakrishnan
2018-04-19 19:20:45 -07:00
parent e1f35a8d9f
commit 774c9e435e

View File

@@ -1074,7 +1074,7 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
var needed = app.manifest.memoryLimit || DEFAULT_MEMORY_LIMIT; // RAM+Swap
var used = this.getInstalledApps().reduce(function (prev, cur) { return prev + (cur.memoryLimit || cur.manifest.memoryLimit || DEFAULT_MEMORY_LIMIT); }, 0);
var roundedMemory = Math.round(this.getConfig().memory / (1024 * 1024 * 1024)) * 1024 * 1024 * 1024; // round to nearest GB
var totalMemory = roundedMemory * 1.2; // cloudron-system-setup.sh creates equal amount of swap. 1.2 factor is arbitrary
var totalMemory = roundedMemory * 1.5; // cloudron-system-setup.sh creates equal amount of swap. 1.5 factor is arbitrary
var available = (totalMemory || 0) - used;
return (available - needed) >= 0;