Skip to content

What This Adds In Cloud Code

  • Manual GC trigger for memory-heavy jobs.
  • Can reduce pressure after large in-memory transformations.
  • Simple success indicator (true).

Quick Start

js
const gc = require('gc');
await processLargeBatch();
gc.run();

API

FunctionParamsReturnsNotes
run()nonebooleanRuns GC cycle and returns true.

Practical Example

js
const gc = require('gc');

Nimbu.Cloud.job('cleanup-large-export', async () => {
  await buildArchive();
  gc.run();
});

Failure Modes & Gotchas

  • Use only when needed; avoid calling in tight loops.
  • Does not replace proper streaming/chunking design.