Out-of-memory error using CSV Import module

So:

  1. The jobs do get run using the PHP CLI by default, so it’s the CLI’s configured memory limit that’s relevant.

  2. I suspect that GD vs. ImageMagick is actually the relevant difference here: in some configurations, the GD module can count the memory usage of loaded files against the PHP memory limit: this can be particularly bad because that’s the uncompressed size that would be counted there, so it could be quite a bit larger than the on-disk size in some cases. For the default ImageMagick configuration, none of the memory usage is counted against that limit since the processing happens in a separate process.

    You don’t specify which is which but if the problematic one is using GD that would be my guess.

  3. The GD thumbnailer is written to clear both the loaded originals and the generated thumbnails out of memory when they’re done or when there are errors in the process. Of course, it’s possible there’s some issue here where it’s not happening as it should, but I’m not aware of one. Your test output definitely seems to indicate some kind of memory leak, though.

    My immediate area of suspicion as to a possible culprit if the leak is in our GD code somewhere would be the stuff that deals with the ICC profile, which was added later. There’s also the possibility that the leak is within GD itself, though that’s probably less likely.