[Bug] functionalTests for custom gradle plugins

Just want to re-publish the question asked/reported at Gradle Custom Plugin (Kotlin) fails with OOME

It sounds for me like a bug in gradle 5.6.2 “during functional tests execution gradle do not release allocated by test resources”