Deleting stale template stuck fatal memory error So all my background tasks Craft 3.2.6 seem to process ok except deleting stale template caches. Although craft is supposed to fail after 5 minutes, it fails instantly and the error log shows  

Allowed memory size of 1610612736 bytes exhausted (tried to allocate 380928 bytes) 


Server settings for memory are 512M and 300 second timeout. The error is instant - in that the error log is immediately populated on saving an entry - which makes me think that this is not the real problem. The server is running Nginx as a reverse proxy for apache and uses microcaching and I wonder if this might interfere with that one task?
Its a multisite with 8 languages and I guess quite heavy on the fields and image processing. 
How can I debug this further - short of giving the whole dedicated box memory to this one site?
Anything in queue.log that gives us hints? Anyway if it is just the stale template caches task... I'd just truncate the cache tables manually (n.b.: truncate, not delete):

templatecaches


You only need to truncate that one cache table, because it'll cascade can remove the other related columns in templatecacheelements and templatecachequeries as well.

Then I'd truncate the queue table as well to remove the no longer needed stale template cache queue jobs.

Learn more:


Zen and the Art of Craft CMS Log File Reading
The Craft {% cache %} Tag In-Depth