Skip to content

Performance Optimization

Optimize your instance to handle large codebases and high-frequency scan volumes.

1. Resource Allocation Matrix

Adjust your hardware and JVM settings based on your total Lines of Code (LoC).

Total LoCMin RAMRISK_XMX (Analysis)ANALYSER_XMX (Engine)
< 500k16 GB-Xmx2g-Xmx8g
500k - 2M32 GB-Xmx4g-Xmx16g
2M+64 GB+-Xmx8g-Xmx32g

2. Applying Memory Settings

Modify these values in your docker-compose.yml or docker run command to prevent OutOfMemory errors during deep scans.

bash
# Docker Run Example
-e RISK_XMX=-Xmx4g \
-e ANALYSER_XMX=-Xmx16g

3. Database Optimization

For instances with 100+ repositories:

  • SSD Storage: Ensure PostgreSQL data volumes are mounted on high-speed SSDs.
  • Connection Pooling: For external DBs, ensure max_connections is set to at least 200.

4. Maintenance

  • Log Rotation: Periodically clear the gamma_data/logs directory to save disk I/O.
  • Snapshot Cleanup: Use the Admin > Cleanup settings to remove old snapshots of deleted branches.