Is there a size limit for trap reports?

If I attempt to create a report for several months for all the traps on all the lines of the project with which I’m involved, after a longish wait my browser often displays an error message something like this:-

“Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 135168 bytes) in /var/www/html/web/sites/all/modules/contrib/views/theme/theme.inc on line 593”

and sometimes it just presents me with a blank page.

If I gradually reduce the number of days I eventually get a report which I can download as a .csv file.

It seems that the report I’m trying to generate is too large. It’s not a really serious problem as I can always create multiple shorter reports and concatinate the .csv files. But I’m interested to know:-

    • could this be associated in some way with my browser’s settings?
    • is there a fundamental limit to what the database can manage and / or can the maximum report size be increased?
    • is this a bug in the trap.nz software?

Does anyone know?

Kia ora,

Thanks for getting in touch! I’ll ask the dev team and let you know what they say :slight_smile:

Ngā mihi,
Sarah
(she/her)

Hi SR1

The site is built using Drupal, and the report you are requesting is a view into the data in the database. If you request a lot of data, the software will try to load all of the records from the database into memory before processing it to generate the report, resulting in the error you see as there is insufficient memory available.

There are three solutions:

  1. Request less data, which you have already found, or
  2. Make the report view more efficient by loading less data for each item (although this would eventually run out of memory too), or
  3. Restructure the report to collect the data in batches so that it does not run out of memory on any single batch, and the process can be repeated with a new batch until all the data has been gathered and built into the requested report.

Hope this helps bot you and the support team.

Regards,
James

1 Like

Hi @SR1

We are working our way through the reports and optimising where we can. Can
please send through some details to support@trap.nz (which project, which report you are running, and the date range and filters), that would be helpful. Thx

Fixed now :slight_smile: There is no size limit to the reports, but there is a limit to the number of records that can be displayed per page. This is now set to a maximum of 100 in most cases (you can still page to the next lot of records). Note: exports will contain all records that match your filters.