Nimbu Developer Docs
Module Reference

gc

Trigger garbage collection manually inside Cloud Code.

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

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

API

FunctionParamsReturnsNotes
run()nonebooleanRuns GC cycle and returns true.

Practical Example

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.

On this page