TRIGGER GC

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

Introduction

Garbage collection is a process where unneeded versioned nodes for multi-version concurrency are eliminated. These versioned nodes can also be parts of a skip list index or hash index for in-memory data (for rowstore tables or columnstore segments stored in memory). A buffer manager maintains unused memory blocks for future use until no query or operation is using the unused memory anymore.

The garbage collection process automatically runs in the background, so it's normally not necessary to execute TRIGGER GC [FLUSH]. However, if memory-related errors or node failures are being generated, executing TRIGGER GC [FLUSH] might be appropriate. You can specify the number of garbage collections threads to run via the rowstore_gc_thread_count engine variable.

Syntax

TRIGGER GC [FLUSH]

Arguments

  • FLUSH: Releases all unused memory back to the operating system.

Remarks

  • 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, use the FLUSH option. (SingleStore only caches memory when it is available and not under any duress. Hence, this practice may turn out to be counter-productive because the caches will refill themselves over time as queries run.)

    • 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.

  • This command can be run on any aggregator.

  • Only users with SUPER privileges can run this command.

  • Refer to the Permission Matrix for the required permission.

Examples

TRIGGER GC FLUSH;

Last modified: August 12, 2024

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK