Allow memoryLimit to be unrestricted programatically

This commit is contained in:
Girish Ramakrishnan
2017-01-19 15:02:12 -08:00
parent 319632e996
commit 155995c7f3
3 changed files with 8 additions and 3 deletions

View File

@@ -157,8 +157,7 @@ function createSubcontainer(app, name, cmd, options, callback) {
// first check db record, then manifest
var memoryLimit = app.memoryLimit || manifest.memoryLimit || 0;
if (developmentMode) {
// developerMode does not restrict memory usage
if (memoryLimit === -1) { // unrestricted
memoryLimit = 0;
} else if (memoryLimit === 0 || memoryLimit < constants.DEFAULT_MEMORY_LIMIT) { // ensure we never go below minimum (in case we change the default)
memoryLimit = constants.DEFAULT_MEMORY_LIMIT;