Introduction
High-volume data processing tasks, such as network monitoring and video streaming, demand both high throughput and low latency. In the Java ecosystem, these requirements are often at odds with the language's managed memory model. The primary obstacle is the Garbage Collector (GC), which introduces "stop-the-world" pauses that can disrupt microsecond-scale timing. This paper presents StreamFlex, an extension to the Java language and runtime designed to provide real-time stream processing capabilities without sacrificing the productivity of object-oriented programming.
System Design and Methods
StreamFlex achieves high performance by combining a restricted type system with a specialized real-time virtual machine. The architecture focuses on isolating processing units and managing memory explicitly to bypass traditional GC bottlenecks.
Filter Isolation
The fundamental unit of processing in StreamFlex is the filter. Filters are isolated components that do not share mutable state through the global heap. A pluggable type checker for the Java compiler ensures that references do not "leak" across filter boundaries, maintaining strict isolation and preventing dangling pointers.
Region-Based Memory Management
To eliminate GC pauses in the critical path, StreamFlex replaces the single global heap with three specialized memory regions:
- Stable: Persistent memory for a filter's long-term state.
- Transient: A "scratchpad" for individual filter executions, reclaimed in constant time upon completion.
- Capsules: Specialized objects used for message passing.
This architecture allows the stream engine to run indefinitely without triggering garbage collection cycles. Furthermore, the system uses Zero-Copy Messaging, transferring pointers to capsules between filters rather than copying data, which significantly boosts throughput.
Inter-World Communication
StreamFlex uses Preemptible Atomic Regions—a form of Software Transactional Memory (STM)—to facilitate communication between the real-time stream engine and the standard Java heap. This allows high-priority filters to preempt standard Java threads; if a conflict occurs, the transaction rolls back and retries, ensuring timing predictability.
Experimental Results
The authors evaluated StreamFlex using benchmarks including an Intrusion Detection System (IDS), BeamFormer, and FilterBank.
- Throughput: StreamFlex achieved a 3.5x to 4x speedup over equivalent Java code running on a real-time VM (Ovm).
- Predictability: In signal processing tests, StreamFlex maintained a steady 80µs period with minimal jitter. Standard Java (HotSpot) suffered from 67ms latency spikes due to GC.
- Real-world Application: The IDS implementation processed network data at 750 Mib/s, demonstrating readiness for high-bandwidth environments.
Conclusion
StreamFlex demonstrates that Java can be adapted for high-throughput, low-latency stream processing by introducing targeted restrictions and VM extensions. By utilizing region-based memory and implicit ownership, it provides a performant, GC-free execution environment while remaining accessible to Java developers. Future research will explore dynamic graph reconfiguration and multi-core scalability.
Summary updated