Looking at slow requests in newrelic for a product listing page the top function called was Mage_Catalog_Model_Product_Image::_checkMemory() which does a bunch of stuff like checking the ini settings for memory_limit (ini_get('memory_limit'), checks the image size and calculates the memory needed for that and so on...

I've just added a return true (skip the checks, Magento has enough memory for those processes) in that function and the graph below shows the impact.

Anyone else did anything about this? Ideas, risks?

enter image description here

  • 3
    Did the same thing, no problem I'm aware of unless the store admins start uploading monster image files. – Vinai Jun 12 '13 at 14:05
  • 1
    I've done this exact thing! No adverse effects that I've witnessed so far. – philwinkle Jun 12 '13 at 14:10
  • Shall we submit a patch to Magento? :) – FlorinelChis Jun 13 '13 at 9:53
  • A patch for Magento 2 to make it configurable would be nice. Defaulting it to "check memory limit" wouldn't break the shop for users in limited environments as Alan mentions below. – Matthias Zeis Aug 15 '13 at 7:58

Other than the usual caveats about you'll need to merge these changes with upgrades yourself, there doesn't appear toe anything in those methods that changes PHP or Magento state in a significant way. They appears to be there strictly to help users who are running Magento in a memory limited environment to avoid PHP crashes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.