Join the MemSQL Community Today
Get expert advice, develop skills, and connect with others.

TRIGGER GC

Triggers the garbage collector on the source aggregator and propagates to all the leaves.

Syntax

TRIGGER [n] GC [FLUSH]

Arguments

  • FLUSH: Releases all unused memory back to the operating system.
  • n: Specifies the number of passes of the GC to run. By default, MemSQL runs 3 passes of the GC.
  • The garbage collector runs automatically. You may still need to manually trigger the GC in the following scenarios:
    • If you need to free up the cached memory using the FLUSH option. (MemSQL only caches memory when it is available and not under any duress. Hence, this practice may turn out to be counter-productive.)
    • If one of the partitions is using more memory (while bulk-loading/deleting data or recovering from a restart) and you are forced to wait until the garbage collection completes.

Remarks

  • This command can be run on any aggregator.
  • Only users with SUPER privileges can run this command.

Examples

TRIGGER GC FLUSH;