Title: Allowed memory size exhausted [FIXED]
Last modified: August 21, 2016

---

# Allowed memory size exhausted [FIXED]

 *  Resolved [SebastiaanO](https://wordpress.org/support/users/sebastiaano/)
 * (@sebastiaano)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/allowed-memory-size-exhausted-fixed/)
 * While using the plugin, the allowed memory size was exhausted (2GB!). We found
   a solution by changing the following line in the plugin:
 * _file ./includes/class-ure-lib.php line 828 in version 4.14_
 *     ```
       WHERE meta_key='$meta_key' AND meta_value like '%$key%'";
       ```
   
 * to
 *     ```
       WHERE meta_key='$meta_key' AND meta_value like '%$key%' GROUP BY meta_value";
       ```
   
 * Please alter this in this great plugin 🙂
 * [https://wordpress.org/plugins/user-role-editor/](https://wordpress.org/plugins/user-role-editor/)

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

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/allowed-memory-size-exhausted-fixed/#post-4951755)
 * Thanks for the useful suggestion. I see the problem.
    I offer to use this version
   of updated query instead as it does not use filesort operation and thus, should
   be more effective:
 *     ```
       SELECT DISTINCT meta_value
              FROM $table_name
              WHERE meta_key='$meta_key' AND meta_value like '%$key%';
       ```
   
 * Can you confirm that it will not eat a lot of memory at your database?
 *  Thread Starter [SebastiaanO](https://wordpress.org/support/users/sebastiaano/)
 * (@sebastiaano)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/allowed-memory-size-exhausted-fixed/#post-4951785)
 * There should not be too much difference in execution-plans. Both should work (
   plugin didn’t use all allowed memory anymore in both cases). So “confirmed” 😉
 * Blog post about “DISTINCT vs GROUP BY” [here (sqlmag.com)](http://sqlmag.com/database-performance-tuning/distinct-vs-group).
 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/allowed-memory-size-exhausted-fixed/#post-4951786)
 * Thanks. This fix will be published with the next update.

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

The topic ‘Allowed memory size exhausted [FIXED]’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

## Tags

 * [memory size exhausted](https://wordpress.org/support/topic-tag/memory-size-exhausted/)

 * 3 replies
 * 2 participants
 * Last reply from: [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/allowed-memory-size-exhausted-fixed/#post-4951786)
 * Status: resolved