Possible memory leak - GeneratePendingTransforms/ImageMagick Wondering if anyone else has had issues with memory and a large amount of image transforms.

I seems like perhaps memory is not being freed up between transforms. When GeneratePendingTransforms is running, that process skyrockets my CPU and memory, and just keeps climbing until it is done.

Possibly related: https://stackoverflow.com/questions/9993085/php-imagick-memory-leak/12835966#12835966
I had this same issue with an image-heavy site hosted on WebFaction w/ PHP5.6, using latest Craft 2.6.x version. 

I added the fix Brad mentions + another config line:

// From http://stackoverflow.com/a/12835966
// Pixel cache max size
$this-&gt;setResourceLimit(\Imagick::RESOURCETYPE_MEMORY, 256);
// Maximum amount of memory map to allocate for the pixel cache
$this-&gt;setResourceLimit(\Imagick::RESOURCETYPE_MAP, 256);


in craft/app/vendor/pixelandtonic/imagine/lib/Imagine/Imagick/Imagick.php at line 33, at top of smartResize() function.

This was before adding the 'generateTransformsBeforePageLoad' =&gt; true, line to our config, I haven't tested removing this setting after adding that to our config. 

When still in heavy development, we'd clear image asset caches and the transform queue would grow like crazy, and PHP processes would grow past 1.5gb until our host killed all of our processes. I haven't seen this issue since adding those Imagick settings.