Virtual Memory Size

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 25, 2017   (RSS)

By Dave - April 25, 2017

Hi Tim, 

Generally, because servers are much cheaper than programming time we recommend optimizing last.  With most general sites you'll never have to.  And then when it becomes a problem you can "spot optimize" as needed.

My first guess is you're loading a table with 100 or 1000+ records completely into memory.  loadCreatedBy will save a bit of memory but not much.  If you're using over 200 megs then a LOT of data is being loaded into memory.

You could try this plugin I wrote a while back to alert you to any memory heavy or slow loading pages.  Anytime it detects a page that takes over 2 seconds to load or 10 megs of memory (those limits are configurable) it logs an entry in the error log.  It's great for finding problem pages:
https://www.interactivetools.com/forum/forum-posts.php?postNum=2237150#post2237150

Also, setting the PHP memory_limit will just have the script die with an error (eg: HTTP 500 Script Error) or stop half way through loading when the memory limit is reached.  You really want to get to the root cause.  It's almost always loading lots and lots of records when it's not needed.

Hope that helps, let me know any questions!

Dave Edis - Senior Developer
interactivetools.com