Call requestGarbageCollection in Isopack#_writeTool.

This method appears to be causing large spikes in memory consumption on
Circle CI during the `meteor --get-ready` preparation step, which often
leads to the test process being killed.

Also added a call in IsopackCache#_loadLocalPackage for good measure.

We're now calling requestGarbageCollection pretty frequently when
we run Node with --expose-gc, but that currently only happens during
Circle CI tests, so I don't think we need to implement the improvements
suggested in tools/utils/gc.js, yet.

Previously: 35f488e140, f6df21ff1e
This commit is contained in:
Ben Newman
2017-05-15 16:00:20 -04:00
parent 35386e49dd
commit 47496e9dba
2 changed files with 9 additions and 0 deletions

View File

@@ -383,6 +383,8 @@ export class IsopackCache {
});
}
}
requestGarbageCollection();
}
}

View File

@@ -14,6 +14,7 @@ var utils = require('../utils/utils.js');
var buildPluginModule = require('./build-plugin.js');
var Console = require('../console/console.js').Console;
var Profile = require('../tool-env/profile.js').Profile;
import { requestGarbageCollection } from "../utils/gc.js";
var rejectBadPath = function (p) {
if (p.match(/\.\./)) {
@@ -1802,6 +1803,8 @@ _.extend(Isopack.prototype, {
symlink: false
});
requestGarbageCollection();
// Build all of the isopackets now, so that no build step is required when
// you're actually running meteor from a release in order to load packages.
var isopacketBuildContext = isopackets.makeIsopacketBuildContext();
@@ -1812,6 +1815,8 @@ _.extend(Isopack.prototype, {
// process are going to be the current tool's isopackets, not the
// isopackets that we're writing out.
_.each(isopackets.ISOPACKETS, function (packages, isopacketName) {
requestGarbageCollection();
buildmessage.enterJob({
title: "compiling " + isopacketName + " packages for the tool"
}, function () {
@@ -1830,6 +1835,8 @@ _.extend(Isopack.prototype, {
return;
}
requestGarbageCollection();
image.write(
builder.enter(files.pathJoin('isopackets', isopacketName)));
});