Apama 10.7.2 | Developing Apama Applications | Developing Apama Applications in EPL | Working with Streams and Stream Queries | Troubleshooting and stream query coding guidelines | Avoid using large windows where possible
 
Avoid using large windows where possible
In Apama, all data being processed is held in memory, including data within stream windows. If you specify query windows that contain a large number of items or hold items for a long period of time, the memory that the application uses necessarily increases.
A memory requirement that is more than the memory available to the application causes paging to occur, which can decrease application throughput. Where possible, consider reducing the size of any stream query windows by doing one or more of the following:
*Filter items to reduce the number or size of the items in the window.
*Use a complex event expression to achieve the same result.
*Use retain all instead of specifying a within clause. See In some cases prefer retain all to a timed window for details.