Hello everyone !
First at all, sorry for my bad english.
I’m using modx (v0.9.6.1p2) for a big website with many functionnalities :
- 2500 documents
- 500 different ressources (templates, TVs, snippets, chunks...)
Modx is running on an restricted environnement, on witch I do have a very limited access (no ssh/ftp).
The main limit is (was) the 8Mo memory allocated to each php instance.
I have had a strange problem :
Some people duplicated a few documents (4-5), and from this point, every modx pages,
*including manager*, were displaying the following error :
Allowed memory size of 8388608 bytes exhausted (tried to allocate 6291456 bytes)
The error was located on line 14987 of
assets/cache/siteCache.idx.php
The code area of my siteCache.idx.php was :
14984 : //Include a custom config file if specified
14985 :
14986 : $config = (isset($config)) ? "{$wayfinder_base}configs/{$config}.config.php" : "{$wayfinder_base}configs/default.config.php";
14987 :
14988 : if (file_exists($config)) {
14989 :
14990 : include_once("$config");
14991 :
14992 : }
For info, my siteCache.idx.php is 692 Ko.
Here is what i tried to solve the problem :
- I tried to run the site on my local developpement server, using the same memoty limitation (8Mo), + the same database + the same sitecache.idx file. And I added log lines to check memory_usage everywhere in documentparser.inc.php. It was each time 3-5Mo.
- I put on the production server an old version of sitecache.idx. Then I was able to access to the manager. But when I was refreshed the site, same memory error.
- I tried to delete some parts of documentparser to see the area where a file inclusion could break php/memory limit. It had random results...
The error disappeared when the memory limit was raised to 16 Mo (8Mo before the incident)
Questions :
1) How is it possible, how can it happen ?
2) Is it a php or a modx problem ?
3) Is there a way to solve this problem, without having to raise the memory limit ?
4) Is there a way to monitor the memory used ?
5) Ok, the error was reported to me by someone else, so I’m not 100% sure the error was on this line. Could it come from somewhere else? (remember the whole site was broken)
6) I heard about a new version of modx, 0.9.7, solving cache problems. Is it still in project ? If yes, when is it planned ? Or is it about the evolution/revolution project ?
Thanks by avance !