Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 80 bytes) only opening Piwik login-page

Hello,

Since the update to Piwik 2.x I have problems with the “memory exhausting”.

First it was possible to login, but there was no css-style on the page. So it was very hard to view the statistics.
With a little searching, I found out that the php page loading the stylesheet was giving an error at loading: “Fatal error: Allowed memory size of xxxxx bytes exhausted (tried to allocate xx bytes)” (I don’t remember the exact numbers anymore).

Searching the Piwik forum and FAQ, I found an possible solution. It would be because Piwik is trying to load the css and javascript in one big file.
To change this into separate files, you have to change the config.ini.php file and put the following tekst in it:
"
[Debug]
disable_merged_assets = 1
"
I did this, cleared my browser cache and restarted the browser. But unfortunately it dit not help. The results stayed the same as before.
At this moment I cannot find this solution anymore (removed??).

Since than things had gone worse. Now I want to visit only the statistics page, but I cannot even log in.
The page shows only an error when accessing it:

Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 80 bytes) in /xxx/xxx/public_html/statistieken/vendor/leafo/lessphp/lessc.inc.php on line 1711

Increasing memory for php as suggested in Piwik reports this error and fails: “Fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes)”. What should I do? - Analytics Platform - Matomo and other threads is not an option, because it is an hosting server and I’m not able to change the php.ini.

I have searched the issue tracker, but did not find a recent added bug on this.

And as mentioned before: it has started with the installation of Piwik version 2. So I don’t think that increasing the memory is the solution, but there is something within the Piwik code that uses too much memory or has a memory leak.

I hope there will be a solution to get Piwik working (going back to Piwik 1.x ?). Otherwise I have to search again for an statisics/analytics solution (Google analytics?).

What are your server, php specs? Is it a particular CMS or just web page how are you injecting the piwik code? Via a plugin or include of some sort? Is there any server cacheing in place?

Would you happen to be using suhosin memory?

The server is a shared hosting server with Linux OS, Apache 2.2.27, PHP 5.3.28 and MySQL 5.5.36-cll

The site is made with Joomla 2.5.20 and the Piwik code is inserted via a Piwik plugin.

I don’t know about the use of server caching or suhosin and cannot find information about this. I can ask the hosting provider.

301 Moved Permanently its a fair bit older but echoed your issues.

2 things to try looking at setting up autoarchiving

Setting up memoery setting in php cli if applicable

Thank you for your quick response.

I have looked into the thread you mentioned.
Unfortunately I cannot set up cron jobs. And with a site that is getting less than 100 visitors daily it is not necessary to archive so often, I think.
I have read about the use of “Web Cron” (I can use it to do this manually). For this you need your token_auh. And to get to that token_auth you need to log in. But I cannot log in anymore due to the error. This is becoming a circle.

Also I cannot change the memory limit. I found out that the limit for memory use by PHP is set (by the system manager) to 40 MB.

In the error_log from Piwik I see a lot of lines with the same error.
First a lot of lines with “PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 424957 bytes) in /public_html/statistieken/core/Theme.php on line 100” (every time exactly the same message)
And at one point this is changed to “Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 78 bytes) in /home/enhoenl/public_html/statistieken/vendor/leafo/lessphp/lessc.inc.php on line 1714” (but now the number of allocated bytes and the line number are changing)

For now my conclusion is that Piwik needs more memory than my provider gives.

I have to think to change from hosting provider or statistics provider. :frowning:

Again thank you for your help.

Increasing memory for php as suggested in [piwik.org] and other threads is not an option, because it is an hosting server and I’m not able to change the php.ini.

The solution is to ask your web host to increase memory for you, cheers