Ticket #1632 (assigned defect)

Opened 1 year ago

Last modified 3 weeks ago

SilverStripe.com/admin/ requires more than 64MB memory

Reported by: smagnusson Assigned to: sminnee (accepted)
Type: defect Priority: critical
Milestone: 2.3.0 Component: Sapphire Framework
Version: Severity: medium effort / impact
Keywords: Cc: scott@startgrid.com, michael@wakeless.net
Due date: Hours:

Description

Just an observation that loading silverstripe.com/admin/ occasionally runs out of memory when memory limit is set to 64MB.

When this occurs, I can get around it by loading the admin as: http://www.silverstripe.com/admin/show/1

This well-exceeds the installer's 32MB suggestion, and seems high for the relative simplicity of the page (its no Art Auction Page!)

This just gives you one of many starting points for our memory optimisation :)

Attachments

Change History

Changed 11 months ago by smagnusson

  • milestone set to 2.2.1

Suggest we look at this because ScottiouS in IRC claims 90MB required to login admin.

Changed 11 months ago by scottious

  • cc set to scott@startgrid.com

I have encountered the same problem on a site with currently 449 articles. There was an increase in admin load time once I upgraded from SS 2.0 to 2.1. I cannot login by using the above URL.

The site is requiring 90M to run the admin area (this was what the hosting provider told me) but now the limit is at 80M and it appears to be "Out of memory" at around 40M.

Fatal error: Out of memory (allocated 43778048) (tried to allocate 4864 bytes) in /home/mywebsite/www/sapphire/core/Object.php(122) : eval()'d code on line 1

Another note is that this site does have 3,000 comments. I'm not sure if this has an impact on loading the Site Content tab.

Changed 11 months ago by scottious

Correction* The memory increase would have actually been from 2.1.0 to 2.1.1

Changed 9 months ago by sminnee

  • priority changed from medium to critical

Changed 9 months ago by wakeless

  • cc changed from scott@startgrid.com to scott@startgrid.com, michael@wakeless.net

Throughout the backend stuff, memory is pretty much ignored. Often (in the case of the SiteTree?) we will basically do a SELECT * FROM SiteTree and then build DataObjects? for each line. This happens throughout the CMS.

Ways to fix this are implementing the build and destroy of the DataObjects? in the Iterators...

So at the beginning of a foreach the DataObject? is created, at the end it's destroyed. This would fix the top end/high memory limit problem, but would screw performance for record sets < 20 items. But where do we draw the line?

Changed 9 months ago by sminnee

  • status changed from new to assigned

Changed 9 months ago by wojtek

"The memory increase would have actually been from 2.1.0 to 2.1.1" - that's true, I have experianced the same.

What's more, in some cases the installator hung up after printing the message "building the database schema..."

Changed 9 months ago by wojtek

*increasing the memory_limit to 64MB fixes the installation problem on all servers where I have experianced it :)

Changed 9 months ago by sminnee

  • milestone changed from 2.2.2 feature-lock to 2.3

Changed 3 weeks ago by ischommer

See our ideas for the new "data mapper" as a starting point for systemwide optimizations: http://open/wiki/development/NewDataMapper

It would be helpful to know at which points more data is built into PHP than it needs to - the new data mapper would help in cases where a large DataObjectSet? is built, just to filter it down later on through checks which could be expressed in SQL as well.

Changed 3 weeks ago by sminnee

I know that hierarchy generation is very inefficient, certainly in terms of speed and probably memory too, by virtue of the large number of DOSets it creates.

Note: See TracTickets for help on using tickets.