<p><br>
Den 24/07/2012 17.11 skrev "Attila Rajmund Nohl" <<a href="mailto:attila.r.nohl@gmail.com">attila.r.nohl@gmail.com</a>>:<br>
><br>
> Hello!<br>
><br>
> I have a data structure where I manage "historical data": a list of<br>
> timestamps when events happened. I only need to know how many events<br>
> happened in the last 24 hours. When an event happens, I put the<br>
> timestamp into the queue (I use the queue module in OTP). When I check<br>
> how many values are in the queue, I also remove the entries that are<br>
> older than 24 hours. My problem is: when I remove the old elements, I<br>
> can do it one by one and at each step the (possibly big) queue gets<br>
> copied and I run out of memory.<br>
I am curious: how do you manage to do this? Can we see the code? <br>
(Certainly it shouldn't be the case that much copying should be done at each step.)</p>
<p>> Is there a cleverer way to remove<br>
> elements from queue? Or maybe I shall use an ordered_set ETS table<br>
> instead of a queue?<br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</p>