meteor/meteor

View on GitHub
tools/utils/gc.js

Summary

Maintainability
A
0 mins
Test Coverage
import { throttle } from "underscore";

export const requestGarbageCollection =
  // 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.
  typeof global.gc === "function"
    // Restrict actual garbage collections to once per second.
    ? throttle(global.gc, 1000)
    : function () {};