Problem with large reports

I’am using Matomo On-Premise with some high traffic sites. When we are trying to get reports for a period thats is longer that 6 months the request throws an exception or timeout.

We are getting this error inte the loggs:
Fatal error encountered: /var/www/matomo/core/DataTable/Row.php(71): Allowed memory size of 4294967296 bytes exhausted (tried to allocate 20480 bytes)

Isen’t it weird that 4294967296 bytes limit is exhausted but it tried to allocate 2048 bytes?

The memory_limit property in the file is set to 4096M

We have auto archiving set up using a cron job that seems to be running successfully so that should not be the problem. We had problems with running the archiving before but that was fixed when we changed the minimum_memory_limit_when_archiving property in the Matomo config to 4096

Any suggestions?