<div dir="ltr">I'm trying to generate images and after displaying them I want to save them to a png file. I use parallelism to generate them asynchronously with the gui-thread to avoid blocking (don't know if this is really relevant).<div>
<br></div><div style>If I add a single line in the method where I generate the image that creates a class which allocates a pretty big array, slowly but surely the memory starts to rise until it ends in a spectacular out of memory exception. I always thought the garbage collector would deal with it.</div>
<div style><br></div><div style>I tried reducing it but failed. Maybe I should let dustmite bite in it a bit later.</div><div style>How can I manually fix this? Is this a known bug in the garbage collector?</div><div style>
<br></div><div style>btw, this code also caused segfaults on my  64 bit laptop on linux.</div><div style>How can I avoid this?</div><div style><br></div><div style>main class: <a href="https://dl.dropboxusercontent.com/u/15024434/picturegenerator/generalised.d">https://dl.dropboxusercontent.com/u/15024434/picturegenerator/generalised.d</a></div>
<div style><br></div><div style>zip file with everything ready to go to compile:</div><div style><a href="https://dl.dropboxusercontent.com/u/15024434/picturegenerator/picturegenerator.zip">https://dl.dropboxusercontent.com/u/15024434/picturegenerator/picturegenerator.zip</a><br>
</div></div>