-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exhaust of memory when creating large cache #52
Comments
Thanks for the report! I'll be getting to the USU issues in a couple of weeks and will be looking to you to help me validate my solution. |
FWIW, I've reviewed the current handling of the caching and am of the opinion that it's hurting performance (and potentially memory consumption) more than it's helping. For v3.1.0 and later the caching will be automatic and on a per-page basis. That will help performance in the determination of any category, product, manufacturer and ez-page names that are used in multiple spots on a specific page. |
From the, albeit on teeny sites, profiling that I've done, using a per-page cache to not re-determine the various names seems to have a similar performance to the current 'mass' calculation ... without the possible out-of-memory conditions that the current implementation raises. |
- Casting `$cID` to an int at this point 'kills' sub-category URL generation, dropping any `_nnn` additions. The processing further down in the `parse_parameters` method casts the category id to an int when grabbing the category's name. - Removing the (now now present) `USU_CACHE_GLOBAL` use.
I finally had the time to install this on the customers site, and can verify that it now works with a large product database. |
Thanks for taking the time to let me know that the update did, in fact, correct your issue! |
Having 14305 products will freeze zencart (or exhaust allocated memory on server) on language switch to newly installed language when usu starts creating cache for the names.
In this case includes/classes/usu.php, Line: 1155
Calls zen_get_products_name() 14305 times in a loop, which generates 14305 queries to database.
The text was updated successfully, but these errors were encountered: