@wyanglau Did you find any solution to this? We have very similar issue: High CPU Utilization and Frequent Restarts after Upgrading from Keycloak 19 to Keycloak 22
Heap dump indicates issue with Freemarker template engine but no idea if thats real culprit.