Ticket #2145 (new defect)

Opened 12 months ago

Last modified 3 months ago

Statistics section dies on memory usage.

Reported by: dio5 Owned by: qhoxie
Priority: critical Milestone:
Component: Modules - statistics Version:
Severity: medium effort / impact Keywords: statistics, cms, memory limit
Cc: Hours:

Description

I'm on dreamhost with 90M memory limit, still I can't access my statistics section in the cms, getting fatal 'out of memory' errors.

We've tried on several other sites as well on different hostings, with the same result.

I tried with jam13 who put one of his sites at 128M. Then the errors were gone, but he just got a blank page.

The stats section is eating to many memory, or doing something very inefficiently.

I'm filing it at 'critical' because the whole section is broken, of course it won't hurt the main section of the cms.

Change History

Changed 12 months ago by dio5

I wonder how much the next line weighs on the memory usage:

line 39 of Statistics.php:

$record = DataObject::get($class, "", $class.".Created DESC");
$total = $record->TotalItems();
$props = $record->toArray();
$props = $props[0]->toMap();
...

It looks like it's getting every row from the PageView? table by using DataObject::get() without limit.

The PageView? table inserts every view as a new row, so that is a table that quickly grows into thousands of rows, which thus creates a massive DataObject? and then a HUUUGE array.

I believe this needs some rethinking, because there will be no site that can handle this :)

Changed 11 months ago by sminnee

  • milestone changed from 2.2.2 feature-lock to 2.2.3 feature-lock

This definitely needs some re-thinking, and will get that re-thinking in 2.2.3. We'll be revamping the reporting system for that release, too.

Changed 9 months ago by ischommer

  • owner changed from aoneil to qhoxie
  • component changed from CMS - General to Modules - statistics

Changed 3 months ago by sminnee

  • milestone 2.2.3* deleted
Note: See TracTickets for help on using tickets.