Coding for Zero Garbage

Overview

Talon's pooling, messaging and state types are designed to support zero garbage operation once the system reaches steady state. Relying on JVM garbage collection can introduce unpredictable pauses, particularly when applications have large heap sizes. Zero garbage programming eliminates allocation that triggers GC pauses enabling applications to operate at consistently low latencies.

This section discusses techniques and best practices for achieving zero garbage operation with Talon microservices.

Weighing Alternatives

Achieving zero garbage operation is an advanced technique. The cost of engineering software for zero garbage operation can have trade offs in the complexity of the code as the user must be conscious about re-using application objects. In some cases tuning the JVM or using a GC-optimized JVM may be a more cost effective approach. For example, using Azul's Zing JVM provides near pauseless GC with significantly lower development complexity than zero-garbage techniques.

Before pursuing zero garbage techniques, consider:

  • Performance Requirements: Is sub-millisecond latency critical? Standard GC tuning may suffice for many use cases

  • Development Complexity: Zero garbage programming requires careful lifecycle management and reference counting

  • Maintenance Burden: More complex code is harder to maintain and evolve

  • JVM Alternatives: Modern low-latency JVMs like Zing may provide sufficient GC pause reduction

Zero Garbage Techniques

Talon provides several facilities for achieving zero garbage operation:

See Also

Last updated