diff --git a/test/parallel/test-memory-usage.js b/test/parallel/test-memory-usage.js index 8e5ea4de5bf587..7cf6f565732eb2 100644 --- a/test/parallel/test-memory-usage.js +++ b/test/parallel/test-memory-usage.js @@ -19,11 +19,15 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -// Flags: --predictable-gc-schedule +// Flags: --expose-gc --predictable-gc-schedule 'use strict'; const common = require('../common'); const assert = require('assert'); +// Clear stale ArrayBuffer backing stores before taking the baseline so the +// exact allocation delta below is not affected by unrelated cleanup. +globalThis.gc(); + const r = process.memoryUsage(); // On IBMi, the rss memory always returns zero if (!common.isIBMi) {