OutOfMemoryException - EscaperExtension.php

Did anyone experience problems with the escaperextension.php ? I have now at least two instances that throw errors with it once in a while, which ends up with PHP requesting up to 50GB RAM… crashing mautic.

Its related to this: /docroot/vendor/twig/twig/src/Extension/EscaperExtension.php

Error Message: mautic.ERROR: Symfony\Component\Debug\Exception\OutOfMemoryException: Error: Allowed memory size of 536870912 bytes exhausted (t
ried to allocate 46870246080 bytes) - in file /XXXX/docroot/vendor/twig/twig/src/Extension/EscaperExtension.php - a
t line 204

In a contao forum I found the information, that upgrading to PHP 8.1.5 solved it:

Is there any other solution, as PHP 8.1 is only supported with Mautic 5?
Why does it appear now?