17452 Posts in 4473 Topics by 1971 members
Page: 1 2
|Go to End||Next >|
29 November 2007 at 5:19pm
I created a Silverstripe site and currently I am adding content to it. I now have about 300 pictures in the assets folder (no giant file sizes, approximately about 20K average file size - 7 MB all files in total - and no file larger than 100K). If I upload just a few more images (via FTP) and I then open the "assets" tab in the CMS to let Silverstripe know that these files exist I get a "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 46289 bytes)".
I am on a virtual private server and it seems that I cannot allocate more than 32MB to PHP.
It seems the memory_limit problem comes from the number of files, not from particularly large files. Did anyone else have this problem? Is there any workaround or any way to split the execution of the script into smaller chunks so the memory limit does not get exhausted?
The site I am working on is basically ready to go live, but now I am stuck because I cannot add more content.
Nevertheless: thank you for the hard work and efforts you all put into Silverstripe.
Any hints to solve this problem would be highly appreciated.
29 November 2007 at 7:40pm
Are you certain that you cannot set a higher php memory limit in an .htaccess file, or in php as a n ini_set() call?
29 November 2007 at 8:49pm
yes, you are right! I can change the PHP memory_limit in any way: ini_set(), .htaccess, and also in php.ini - I just forgot that for some reason my _config.php file had the line
So whatever memory limit I specified it was reset to 32MB... I don't get a fatal error any more now. Thank you so much to point me to the right direction.
It may still be worth noting that a lot of pictures/files in the assets folder require an increased PHP memory_limit. Do you have any experience what happens when you have heaps more, say 10,000+ images or other media files in the assets folder? Do I have to adjust my memory_limit with the number of uploaded files? It makes sense that the more PHP code I use the more the memory usage increases, but I did not expect that the number of uploaded files could have that effect. But maybe the amount of PHP code that I use on my site is at a critical level close to the 32MB memory limit.
Again, thank you very much for your help! Silverstripe is awesome!
29 November 2007 at 9:39pm
Ultimately, we should look into reducing memory consumption here; could you please add this as a ticket at http://open.silverstripe.com/newticket (you will need to visit http://open.silverstripe.com/register if you've not registered), and this item will be properly itemised and dealt with ;)
Paste the URL of the ticket back here once done...
29 November 2007 at 10:11pm
I added a ticket for this issue (#1929)
29 November 2007 at 10:17pm
28 January 2008 at 9:00pm
I experienced this same problem, however due to some configuration of my host I didn't get any error, just a blank page when trying to view the Files & Images tab in the CMS.
I was able to get it fixed by increasing the memory limit in _config.php:
28 January 2008 at 9:29pm
yes, a fatal "memory exhausted" error usually results in a blank page. You will find the error message in your PHP error log file. This particular error is not displayed in the browser, even if the php.ini file is set to print error messages in the browser window - probably because PHP is in fact really so exhausted that there are not even enough memory resources available to print the error. As you said increasing the memory limit should fix the problem.
Page: 1 2
|Go to Top||Next >|