Skip to content

Garbage Collect gc

Triggers manual garbage collection.

 (gc)
null

Info

  • Frees memory by collecting unused objects
  • Returns null
  • Execution time depends on heap size

Warning

Manual garbage collection should be used sparingly, as the runtime automatically manages memory

Tip

Use gc when you need to explicitly free memory after large operations