I have implemented a simple statistical engine to return rolling mean and variance using a deque to provide a data queue.
The deque is constructed with a number of entries equal to the rolling number of values.
When a new value arrives the oldest value is popped of the front and the new one pushed onto the back.
I need to be sure that this is not going to grow in memory as it is expected to run as a background task for a long time.
Does deque allocate on the heap in use? Are there flags that I can use to fix its size?
I am using G++ 4.1.2 on RHEL 5.3