Skip to content

Improve memory management in DataTable/CSV #19158

@JasonMortonNZ

Description

@JasonMortonNZ

We are seeing this error occur more regularly now, particularly with CSV format. It tends to appear more when there are visits with many actions, forms, media, etc.

{
    "type": 1,
    "message": "Out of memory (allocated 1982181376) (tried to allocate 163840 bytes)",
    "file": "/var/www/html/core/DataTable/Renderer/Csv.php",
    "line": 199,
    "request_id": "4ad9e",
    "backtrace": " on /var/www/html/core/DataTable/Renderer/Csv.php(199)\n",
    "safemode_backtrace": "#0 [internal function]: Piwik\\Plugins\\Cloud\\Controller->safemode(Array)\n#1 /core/FrontController.php(626): call_user_func_array(Array, Array)\n#2 /core/FrontController.php(168): Piwik\\FrontController->doDispatch('Cloud', 'safemode', Array)\n#3 /core/FrontController.php(99): Piwik\\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#4 /core/FrontController.php(274): Piwik\\FrontController::(Array)\n#5 [internal function]: Piwik\\FrontController::triggerSafeModeWhenError()\n#6 {main}"
}

Also listing the API calls here in case these are helpful :)

GET: {
    "module": "API",
    "format": "TSV",
    "idSite": "229",
    "period": "range",
    "date": "2022-04-11,2022-04-15",
    "method": "Live.getLastVisitsDetails",
    "filter_limit": "10000",
    "expanded": "1",
    "translateColumnNames": "1",
    "language": "en",
    "token_auth": "XYZANONYMIZED",
    "force_api_session": "1",
    "format_metrics": "bc"
}

POST: {
    "token_auth": "XYZANONYMIZED",
    "module": "API",
    "format": "TSV",
    "idSite": "229",
    "period": "range",
    "date": "2022-04-11,2022-04-15",
    "method": "Live.getLastVisitsDetails",
    "filter_limit": "10000",
    "expanded": "1",
    "translateColumnNames": "1",
    "language": "en",
    "force_api_session": "1",
    "format_metrics": "bc"
}

Metadata

Metadata

Assignees

Labels

StabilityFor issues that make Matomo more stable and reliable to run for sys admins.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions