Forum: Memory Issues with larges files for jawstats/mawstats 0.8... PATCH/FIX + Things to fix for next rel


« Back To Thread List

3896 days ago
This issue concerned last releaseed of Jawstats 0.7Beta
and also mawstats 0.8 RC1

I had an issue: for some specific months, the data would not showed up. after debugging some time, i found out what was the problem.

the script crashed in the clsAWStats class.
exactly at the line where it tries to load the file : "$this->sAWStats = htmlspecialchars(file_get_contents($sFilePath));"

using file_get_contents would crash simply because of memory issues.

On my server, memory limit was 12 MB and crash could be observed on large awstats files of files starting around 4MB. when it tries to load many files that would not simply work.

so a quick fix would be to place up at the beginning of the script


and that works!

I have tried with "32M", would show up for a month but not for results including many months.

For next release:

1°) maybe add this optional php line in the config file,

2°) Add a notice to check memory usage

3°) Optimize the script to make sure that it is not eating CPU or RAM. A nice work would be to check the memory usage after each page.

Add a footer to show CPU/Memory Usage maybe to look for codes that are not very much optimized

4°) Add maybe some HARD FLUSH to clean buffer, and make sure only required data is loaded in memory, not the whole thing.
3896 days ago
btw, good work :) I guess i will focus on mawstats, the fork since jawstats is dead for almost 10 months now.

« Back To Thread List

Participate in this discussion


You must be logged in to post in this thread.


Version 0.7 beta available now

Released 25th Janury 2009

Try the online demo or download now.

Latest JAWStats News:

Version 0.7 Beta Released

Sprechen Sie Deutsch? Multi-lingual JAWStats v0.7 is finally here.

posted 25th Jan '09. read more »

Help JAWStats

Please donate a dollar (or more!) towards the hosting costs for this site. This money doesn't go anywhere near my pocket, it is purely used against my hosting bill.


Get $50 off your webhosting

You could do far worse than choose Dreamhost. I've used them for 6 years and they're great. Simply enter the promo code: JAWSTATS on signup!