Files
meteor/tools/utils/gc.js
Ben Newman ab0f9ba290 Force garbage collection more aggressively during meteor --get-ready.
This is an effort to keep the `meteor --get-ready` command from running
out of memory during Circle CI tests, as mentioned in this comment:
https://github.com/meteor/meteor/pull/8327#issuecomment-284431618
2017-03-06 20:34:56 -05:00

13 lines
457 B
JavaScript

// For this global function to be defined, the --expose-gc flag must have
// been passed to node at the bottom of the ../../meteor script, probably
// via the TOOL_NODE_FLAGS environment variable.
const gc = global.gc;
// In the future, this function may become smarter about how often it
// actually calls the gc function, but that's an implementation detail.
export function requestGarbageCollection() {
if (typeof gc === "function") {
gc();
}
}