Changed the memory_limit in php.ini from 512M to 512000000 and this value is shown in the nextgen-gallery dashboard server settings.
PHP Memory Limit : 512000000
PHP Max Upload Size : 64M
By the way, in wp-config.php the memory limit is accordingly
define('WP_MEMORY_LIMIT', '512M');
But still a memory error occurs when the gallery of > 75000 images is accessed in the backend
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 2048 bytes) in ../wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/class.datamapper_driver_base.php on line 120
How can this happen as the php memory on the server is 512M ( and it really is when checking with a “phpinfo()” file) ?
This is a workaround the problem: the memory limit in the admin section has to be raised
define('WP_MAX_MEMORY_LIMIT', '1024M'); in wp-config.php
then the gallery can be shown in the admin backend.
but this still does not solve the dissappeared M in the dashboard server settings and the php memory json_decode error in the datamapper class.
As I understand, json_decode happens in memory; with a large gallery a lot of memory is used. I have read some forum suggestions about using a parser of your own converting the object in memory to an array or something like that trying to avoid the memory problem. Like here http://forums.phpfreaks.com/topic/288266-json-encode-exceeds-allowed-memory/ Hopefully this helps the developers?
@vakantie Ameland – We simply do not display the “M” … as to the actual limit issue. It seems rather odd you would have to use such a high setting. Also to note, some web hosting services simply have a non-user modifiable limit set no matter what value you try to assign, have you verified that is not the case here?
– Cais.
@cais tnx for your answer. the M puzzle has been solved now 😉
About the high settings, this is the setting that works
`define(‘WP_MEMORY_LIMIT’, ‘128M’);
define(‘WP_MAX_MEMORY_LIMIT’, ‘512M’);
Lower values then these do not work anymore. I completely control the server, so everything is modifiable.
Loading of a page with 40 images from the huge gallery (has grown to over 135000+ images now) on the frontend takes more then 100 seconds. Load on the server is not stressful, just 2 on a 4 core CPU.
When loading a page with 40 images from a smaller gallery (< 10000 images) the page loads in less then 10 seconds.
So I guess json_decoding the data string takes a lot of time / memory
@vakantie Ameland – Thanks for the updates … we will have to look further into large scale gallery as the ones you are describing.
I’ll ask our developers to have a look at this topic so they can get a sense of what you are seeing.
– Cais.