OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Counter Plugin Error

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Counter Plugin Error

Postby sdellis » Fri Oct 26, 2007 8:43 am

When I try to view the Counter Statistics my allowed PHP memory size (8MB) is exhausted. Is this a bug or am I doing something wrong? I'm sure I could bump up the memory allocation in php.ini, but I'd rather not, and I wonder whether this should be happening in the first place?

Here's the error:
Code: Select all
 PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted (tried to allocate 4097 bytes) in /webroot/journals/plugins/generic/counter/LogEntryDAO.inc.php on line 71


Thanks in advance for any help,
Shaun
sdellis
 
Posts: 13
Joined: Wed Sep 26, 2007 6:55 am

Re: Counter Plugin Error

Postby asmecher » Fri Oct 26, 2007 10:06 am

Hi Shaun,

See http://pkp.sfu.ca/support/forum/viewtopic.php?f=4&t=1625.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Counter Plugin Error

Postby mendesrocha » Fri Dec 07, 2007 12:15 pm

Hello Alec,

I got the same problem. I've set the PHP memory_limit to 128 MB, and we are still getting the following message:

Code: Select all
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4097 bytes) in /data/web/seer2/plugins/generic/counter/LogEntryDAO.inc.php on line 68


We have 17 journals running on our system. We get this while asking for COUNTER Statitics both on our the main page, and in inside the journal pages.

Our log.txt is working, and it has 33 MB.

We indeed need to know the total number of published articles.

Could you help us?

Thanks,
Renato
mendesrocha
 
Posts: 174
Joined: Mon Nov 05, 2007 11:10 am
Location: Brazil

Re: Counter Plugin Error

Postby asmecher » Fri Dec 07, 2007 1:48 pm

Hi mendesrocha,

The version of the COUNTER plugin shipped with OJS 2.1.1 attempts to load the entire log file into memory; if you haven't set up log rotation on your server, it'll eventually outgrow your PHP memory limits. The good news is that the plugin only loads the entire log file when you try, as Journal Manager, to view the log. We have a partner institution working on overhauling the COUNTER stats plugin so that this restriciton is removed, but in the meantime, I'd suggest 1) rotating the log file (probably a good idea in any case) and/or 2) temporarily setting your PHP memory limit to -1 so that the log file can be fully loaded.

I've also found that different versions of PHP vary widely in the amount of memory required to store data structures. If you're currently using PHP4, you may find, for example, that PHP5 can handle a lot more data in a lot less space. (This is anecdotal, so I certainly wouldn't suggest upgrading to PHP5 to try to work around the problem.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Counter Plugin Error

Postby mendesrocha » Sun Dec 09, 2007 5:52 pm

Alec,

We really apreciate your answer and your attention.

Our PHP version is 4.4.7.

How do I rotate the log life? By renaming the actual log and creating a new log periodically? For instance, I should rename the old one to log_september.txt, log_october.txt and so.. ?

Renato
mendesrocha
 
Posts: 174
Joined: Mon Nov 05, 2007 11:10 am
Location: Brazil

Re: Counter Plugin Error

Postby asmecher » Sun Dec 09, 2007 11:17 pm

Hi Renato,

Are you using a UNIX-like server? If so, the tools should already be on the machine -- have a look at e.g. the /etc/logrotate.conf configuration file.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Counter Plugin Error

Postby mendesrocha » Wed Dec 12, 2007 9:55 am

Hello Alec,

Yes, we use a debian-like server.

Setting -1 for the PHP memory worked out.
But, we got the information we need by other way, using the Statitcs for each journal.

The Portal we are working will be relaese next friday.
The adress is http://www.revistas.ufg.br

Thank you again,

Renato
mendesrocha
 
Posts: 174
Joined: Mon Nov 05, 2007 11:10 am
Location: Brazil


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 4 guests

cron