0
votes

A day or two ago I started getting memory issues when trying to access /admin

At first it was on and off and now the site tree doesn't load rendering the admin sections unusable. Anyone know what the issue could be? Or has experienced something like this before?

I tried clearing cache and setting a silverstripe-cache folder but that didn't do anything.

Assuming it could be the code which I've written I moved all the pages types out of the directory, ran dev/build & flush but that the error still persists.

Modules active:
> multivaluefield
> external_auth

Page types : 15

# of pages : 40,261

The error I get is:

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /framework/model/connect/PDOQuery.php on line 26, referer: /admin/pages/

Can anyone suggest where I should focus to fix this? I'm a bit stumped as too what/where the issue is


Update / answer / my solution

I managed to fix the issue (for now)...
What I did was empty the SiteTree_Live table and reverted back to a commit back when I knew my code was running well with no doubts of any memory issues, then I published all the articles again and bumped up the commits until I was back to the most recent one.

It now works and I can get back into the admin panel just fine so it does seem like it was something to do with the amount of data. Increasing the memory limit would have done the trick.

1
Yeah I've seen that, I have 128mb set - Freemium
@Barry Yes it's 3.4 - Modules I have are multivaluefield, external_auth. Page has functionality for setting and displaying location specific content, emailing content authors and as for page types I have 15 - Freemium
Ah sorry I thought you meant page types, as for actual pages there are somewhere around 40k. I thought it may have been my code, I tried commenting out everything I've done in the week prior to this error appearing, flushed the cache and the problem was still there - Freemium
@Freemium Have to ask the obvious: did you try to increase memory limit above that at all or does it exhaust all the memory again? Does the admin work if you grab a copy locally of the project files without any pages in the database? If the latter works I'd presume you could just try to increase the memory_limit in steps coupe of times. And pro tip: git and bisect would help here to rule out coding issues. If you are just commenting out stuff seems that you ought to take a dive in the land of version controlling your projects - Olli Tyynelä

1 Answers

0
votes

This is known limitation in SS. Try to decrease the number of pages under one parent or use module silverstripe-news.

The problem is related to Hierarchy::$node_threshold_total and Hierarchy::$node_threshold_leaf. One of the limits applied incorrectly and more pages than threshold will be loaded into memory.