Memory limit when archiving

I already read all existing topics regarding this issue, but no solution seems to work with me.

Error: Got invalid response from API request: ?module=API&method=API.get&idSite=2&period=year&date=last2&format=php&trigger=archivephp. Response was ’
Fatal error: Out of memory (allocated 358875136) (tried to allocate 8388608 bytes)

The amount 358875136 (approx. 342M) appears nowhere in my settings.

I already tried the following:
In php.ini I set:
memory_limit = 4G

In global.ini.php I set:
minimum_memory_limit_when_archiving = 4096

And I also tried:
minimum_memory_limit_when_archiving = -1

I tryied setting memory_limit when calling:
/usr/bin/php /home2/cbooks/public_html/console core:archive --url= --php-cli-options="-d memory_limit=4G"

Whatever I put any place, the error and the amount (around 342M) stays the same.

Any ideas welcome!