I have a thread that creates objects with status info (about one per second) and adds it to a ConcurrentQuery.
query.Enqueue(new Tuple<string, DateTime>("some info", DateTime.Now));
Another tread reads and clear the info from the queue as often as it can (ideally once a second as well, but after processing the info, it could take longer). From other thread:
if (query.TryDequeue(out toSomeTuple))
{
// Process
}
Because this operations will take place under the application's entire life, will this fragment the memory heavily or does the garbage collector takes care of this in any way? Any hints here about how I can optimize this better?