Title: Error : Memory_limit reached
Last modified: July 30, 2018

---

# Error : Memory_limit reached

 *  [ansaypaul](https://wordpress.org/support/users/ansaypaul/)
 * (@ansaypaul)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/error-memory_limit-reached/)
 * Hi,
 * I try this plugin but i have 100.000+ images on my database.
 * The plugins break the memory_limit set to 512M, when we try to get all the image.
 * To avoid this problem, i just edit and add the year (2018) in the biggest request.
 * And set it to 2018 only.
 * It’s work for me ;).
 * Paul
 * File : resmushit.class.php
 *  $queryAllPictures = $wpdb->prepare(
    “select $wpdb->posts.ID as ID, $wpdb->posts.
   guid as guid, $wpdb->postmeta.meta_value as file_meta from $wpdb->posts inner
   join $wpdb->postmeta on $wpdb->posts.ID = $wpdb->postmeta.post_id and $wpdb->
   postmeta.meta_key = %s where $wpdb->posts.post_type = %s and $wpdb->posts.post_mime_type
   like %s AND YEAR(post_date) = ‘2018’ and ($wpdb->posts.post_mime_type = ‘image/
   jpeg’ OR $wpdb->posts.post_mime_type = ‘image/gif’ OR $wpdb->posts.post_mime_type
   = ‘image/png’)”, array(‘_wp_attachment_metadata’,’attachment’, ‘image%’) );
    -  This topic was modified 7 years, 10 months ago by [ansaypaul](https://wordpress.org/support/users/ansaypaul/).

Viewing 1 replies (of 1 total)

 *  [elevationallah](https://wordpress.org/support/users/elevationallah/)
 * (@elevationallah)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-memory_limit-reached/#post-10752823)
 * Will this fix be incorporated in a future version of the plugin?

Viewing 1 replies (of 1 total)

The topic ‘Error : Memory_limit reached’ is closed to new replies.

 * ![](https://ps.w.org/resmushit-image-optimizer/assets/icon-256x256.png?rev=3049668)
 * [reSmush.it : The original free image compressor and optimizer plugin](https://wordpress.org/plugins/resmushit-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/resmushit-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/resmushit-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/resmushit-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/resmushit-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/resmushit-image-optimizer/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [elevationallah](https://wordpress.org/support/users/elevationallah/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/error-memory_limit-reached/#post-10752823)