Title: Memory limit
Last modified: August 22, 2016

---

# Memory limit

 *  [hpr78](https://wordpress.org/support/users/hpr78/)
 * (@hpr78)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/memory-limit-4/)
 * “Step 3/7: indexing image files and backup meta [Fatal Error!] Logfile”
 * Mem-Limit is 256 MB
    I have over 10.000 Images.
 * Logfile:
 *     ```
       [0.2631] Info: WP_Query results written to log
       [0.0006] Registered sizes: ["thumbnail","medium","large","yith-woocompare-image","post-thumbnail","blog-style-1","blog-style-2","widget-thumb","shop-navigation","shop_thumbnail","shop_catalog","shop_single","shop","list","gallery","product","phone-large","zoom","full"]
       [0.0008] Meta indexed so far: 1 / 10798
       [0.0023] Sample meta:
       {"width":850,"height":642,"file":"2014\/08\/Leo3C9.jpg","sizes":{"thumbnail":{"file":"Leo3C9-150x150.jpg","width":150,"height":150,"mime-type":"image\/jpeg"},"medium":{"file":"Leo3C9-300x226.jpg","width":300,"height":226,"mime-type":"image\/jpeg"},"yith-woocompare-image":{"file":"Leo3C9-220x154.jpg","width":220,"height":154,"mime-type":"image\/jpeg"},"post-thumbnail":{"file":"Leo3C9-56x56.jpg","width":56,"height":56,"mime-type":"image\/jpeg"},"blog-style-1":{"file":"Leo3C9-850x400.jpg","width":850,"height":400,"mime-type":"image\/jpeg"},"blog-style-2":{"file":"Leo3C9-850x400.jpg","width":850,"height":400,"mime-type":"image\/jpeg"},"widget-thumb":{"file":"Leo3C9-45x45.jpg","width":45,"height":45,"mime-type":"image\/jpeg"},"client":{"file":"Leo3C9-234x150.jpg","width":234,"height":150,"mime-type":"image\/jpeg"},"shop-navigation":{"file":"Leo3C9-156x156.jpg","width":156,"height":156,"mime-type":"image\/jpeg"},"portfolio-post":{"file":"Leo3C9-710x642.jpg","width":710,"height":642,"mime-type":"image\/jpeg"},"widget-thumbnail":{"file":"Leo3C9-710x368.jpg","width":710,"height":368,"mime-type":"image\/jpeg"},"showbiz-thumbnail":{"file":"Leo3C9-710x533.jpg","width":710,"height":533,"mime-type":"image\/jpeg"},"front-1":{"file":"Leo3C9-850x460.jpg","width":850,"height":460,"mime-type":"image\/jpeg"},"front-2":{"file":"Leo3C9-850x460.jpg","width":850,"height":460,"mime-type":"image\/jpeg"},"shop_thumbnail":{"file":"Leo3C9-90x67.jpg","width":90,"height":67,"mime-type":"image\/jpeg"},"shop_catalog":{"file":"Leo3C9-150x113.jpg","width":150,"height":113,"mime-type":"image\/jpeg"},"shop_single":{"file":"Leo3C9-300x226.jpg","width":300,"height":226,"mime-type":"image\/jpeg"},"shop":{"file":"Leo3C9-198x150.jpg","width":198,"height":150,"mime-type":"image\/jpeg"},"list":{"file":"Leo3C9-160x140.jpg","width":160,"height":140,"mime-type":"image\/jpeg"},"gallery":{"file":"Leo3C9-198x150.jpg","width":198,"height":150,"mime-type":"image\/jpeg"},"product":{"file":"Leo3C9-435x328.jpg","width":435,"height":328,"mime-type":"image\/jpeg"},"phone-large":{"file":"Leo3C9-760x574.jpg","width":760,"height":574,"mime-type":"image\/jpeg"},"blog-style-1-gray":{"file":"Leo3C9-850x400-gray.jpg","width":850,"height":400,"mime-type":"image\/jpeg"},"blog-style-2-gray":{"file":"Leo3C9-850x400-gray.jpg","width":850,"height":400,"mime-type":"image\/jpeg"},"client-gray":{"file":"Leo3C9-234x150-gray.jpg","width":234,"height":150,"mime-type":"image\/jpeg"},"portfolio-post-gray":{"file":"Leo3C9-710x642-gray.jpg","width":710,"height":642,"mime-type":"image\/jpeg"},"widget-thumbnail-gray":{"file":"Leo3C9-710x368-gray.jpg","width":710,"height":368,"mime-type":"image\/jpeg"}},"image_meta":{"aperture":0,"credit":"","camera":"P45+","caption":"","created_timestamp":1297957717,"copyright":"","focal_length":0,"iso":"50","shutter_speed":"0.016666673547467","title":""}}
       [0.0007] Meta indexed so far: 101 / 10798
       .
       .
       .
       [0.6222] Meta indexed so far: 10798 / 10798
       [0.7691] Info: Valid and Invalid meta results written to log
       [0.0005] Uknown error: Please see returned value below
   
       Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 74 bytes) in /var/www/wp-content/plugins/image-cleanup/image-cleanup.plugin.php on line 953
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [photovolts](https://wordpress.org/support/users/photovolts/)
 * (@photovolts)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/memory-limit-4/#post-5248031)
 * [@hpr78](https://wordpress.org/support/users/hpr78/) Same here. I have about 
   15K images unused by my current theme.
 * Logfile:
 *     ```
       [0.3913] Info: WP_Query results written to log
       [0.0001] Registered sizes: ["thumbnail","medium","large","narrow-featured-image","wide-thumbnail","wide-thumbnail-small","wide-featured-image","aio-thumb","full"]
       [0.0002] Meta indexed so far: 1 / 19895
       [0.0009] Sample meta:
       {"width":937,"height":618,"file":"2014\/06\/future-next-exit.jpg","sizes":{"thumbnail":{"file":"future-next-exit-250x164.jpg","width":250,"height":164,"mime-type":"image\/jpeg"},"medium":{"file":"future-next-exit-530x350.jpg","width":530,"height":350,"mime-type":"image\/jpeg"},"large":{"file":"future-next-exit-800x527.jpg","width":800,"height":527,"mime-type":"image\/jpeg"},"narrow-featured-image":{"file":"future-next-exit-300x180.jpg","width":300,"height":180,"mime-type":"image\/jpeg"},"wide-thumbnail":{"file":"future-next-exit-630x315.jpg","width":630,"height":315,"mime-type":"image\/jpeg"},"wide-thumbnail-small":{"file":"future-next-exit-315x157.jpg","width":315,"height":157,"mime-type":"image\/jpeg"},"wide-featured-image":{"file":"future-next-exit-920x360.jpg","width":920,"height":360,"mime-type":"image\/jpeg"}},"image_meta":{"aperture":0,"credit":"","camera":"","caption":"","created_timestamp":0,"copyright":"","focal_length":0,"iso":0,"shutter_speed":0,"title":""}}
       [0.0000] Meta indexed so far: 1001 / 19895
       [0.0001] Meta indexed so far: 2001 / 19895
       [0.0001] Meta indexed so far: 3001 / 19895
       [0.0001] Meta indexed so far: 4001 / 19895
       [0.0001] Meta indexed so far: 5001 / 19895
       [0.0001] Meta indexed so far: 6001 / 19895
       [0.0001] Meta indexed so far: 7001 / 19895
       [0.0001] Meta indexed so far: 8001 / 19895
       [0.0001] Meta indexed so far: 9001 / 19895
       [0.0001] Meta indexed so far: 10001 / 19895
       [0.0001] Meta indexed so far: 11001 / 19895
       [0.0001] Meta indexed so far: 12001 / 19895
       [0.0001] Meta indexed so far: 13001 / 19895
       [0.0001] Meta indexed so far: 14001 / 19895
       [0.0001] Meta indexed so far: 15001 / 19895
       [0.0001] Meta indexed so far: 16001 / 19895
       [0.0001] Meta indexed so far: 17001 / 19895
       [0.0001] Meta indexed so far: 18001 / 19895
       [0.0002] Meta indexed so far: 19001 / 19895
       [39.2862] Meta indexed so far: 19895 / 19895
       [40.3010] Info: Valid and Invalid meta results written to log
       [0.0004] Uknown error: Please see returned value below
       <br />
       <b>Fatal error</b>:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 2048 bytes) in <b>/home2/earshotp/public_html/pvshingles/wp-content/plugins/image-cleanup/image-cleanup.plugin.php</b> on line <b>953</b><br />
       ```
   
 *  [Criis87](https://wordpress.org/support/users/criis87/)
 * (@criis87)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/memory-limit-4/#post-5248248)
 * Same problem here..
 *  [abshkd](https://wordpress.org/support/users/abshkd/)
 * (@abshkd)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/memory-limit-4/#post-5248251)
 * I just read through the code and did some quick edits to fit my requirements.
   
   The solution is this.
 * 1. Use the filter “Skip image if part of path matches (separate by newline)”
   
   2. Enter by year first like /2012/ /2013/ etc (on separate lines 3. Hit index.
   4. If the index still fails repeat above by filtering by month like so /2012/
   01/ 2012/02/ … make sure you try down to one month index. Then clean one month
   at a time. remove the filters as you proceed.
 * 5. Lastly if it doesnt work, it’s not memory its “max_exection_time”. You can
   raise it for awhile to something like 6000 seconds then fine. You can also edit
   the plugin file and update the php variable unless you are on a shared host. 
   Try with increased max_execution time using steps above.
 * Conclusion: The above is a workaround. I do know where the issue is and it’s 
   nothing to do with this plugin. Some bad plugins are creating too many images
   and leaving a mess around. that won’t help at all. Remove these plugins.
 * Bad plugins:
    1. related posts” from 3rd party not jetpack 2. Amazon S3 plugin
   from Tan tan 3. Theme functions. Any theme that uses sliders is actually bad 
   as the slider plugin itself is a security hole waiting to happen. 4. bad gallery
   settings.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Memory limit’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/image-cleanup_e2e2e2.svg)
 * [Image Cleanup](https://wordpress.org/plugins/image-cleanup/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/image-cleanup/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/image-cleanup/)
 * [Active Topics](https://wordpress.org/support/plugin/image-cleanup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/image-cleanup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/image-cleanup/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [abshkd](https://wordpress.org/support/users/abshkd/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/memory-limit-4/#post-5248251)
 * Status: not resolved