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 the next topic for details.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.