Note that there are some explanatory texts on larger screens.

plurals
  1. POMemory not freed by Application until GC is explicitly called
    primarykey
    data
    text
    <p>I am launching many threads simultaneously, each one writing / reading data into/from a queue; Data is dequeued progressively while it is processed and stored to DB. For some reason <strong>the memory is not freed</strong> although the Queues are empty and I made sure all event subscription between the data reader and the data processor are unsubscribed at the end of the threads.<strong>The amount of squatted RAM is <em>Exactly</em> the amount of the data that is read</strong> by binary readers and put into queues.</p> <p>In order to isolate the problem, I have bypassed the Processing and the DB Storing step. <br>Why would be the RAM still squatted long after all threads are finished, <strong>until I explicitly call <code>GC.Collect()</code> or terminate the program</strong>? I manually nullified the Queue after it is emptied, and also nullified the Binary Reader that read the data. I thought that would be enough for the GC to wake up and do its housekeeping at least after a few minutes.</p> <p><img src="https://i.stack.imgur.com/yOi9b.png" alt="enter image description here"></p> <p><strong>EDIT :</strong> <strong>The (reformulated after deletion) QUESTION :</strong> In short, I was always told that the default GC behaviour managed the memory properly and that I shall almost never call the GC explicitly and let the framework do the job.<br> I would like to know why in this case memory usage drops down only when an explicit Call is made to <code>GC.Collect</code></p> <p><strong>EDIT : <br>Without GC Collect</strong> <br> <img src="https://i.stack.imgur.com/G6mNj.png" alt="enter image description here"></p> <p><strong>With GC Collect</strong> (Called on a regular basis) <img src="https://i.stack.imgur.com/tiiYG.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload