Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Memory-effective queue handling
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dmitry Kolesnikov  
View profile   Translate to Translated (View Original)
 More options Jul 24 2012, 12:11 pm
From: Dmitry Kolesnikov <dmkolesni...@gmail.com>
Date: Tue, 24 Jul 2012 19:11:19 +0300
Local: Tues, Jul 24 2012 12:11 pm
Subject: Re: [erlang-questions] Memory-effective queue handling
Hello,

I do not think that this is a good idea to keep whole 24h statistic is same queue.
For "cleanup" efficiency you could have a queue per time slot (e.g. per hour, per 30min, etc)
Instead of queue, I am using patched gb_trees exactly for same purposes but I am doing both read/write.

- Dmitry

On Jul 24, 2012, at 6:11 PM, Attila Rajmund Nohl wrote:

> Hello!

> I have a data structure where I manage "historical data": a list of
> timestamps when events happened. I only need to know how many events
> happened in the last 24 hours. When an event happens, I put the
> timestamp into the queue (I use the queue module in OTP). When I check
> how many values are in the queue, I also remove the entries that are
> older than 24 hours. My problem is: when I remove the old elements, I
> can do it one by one and at each step the (possibly big) queue gets
> copied and I run out of memory. Is there a cleverer way to remove
> elements from queue? Or maybe I shall use an ordered_set ETS table
> instead of a queue?
> _______________________________________________
> erlang-questions mailing list
> erlang-questi...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.