OOM Gradle 8.5 AGP 8.2.0

After upgrading AGP 8.2.0 , Gradle >= 8.3 Kotlin 1.9.21 and other dependent kotlin compiler libraries like KSP, Compose compiler etc… while running AGP link task.
PermGen quickly take ups the whole heap memory - while gradle task is still in configuration phase.
After analysing the heap dump, looks like LintModelWriterTask from AGP(8.2.0) lint and DefaultUnlockedConfiguration from Gradle(8.5) are major contributors to OOM.

LintModelWriterTask is held by VisitableURLClassLoader, which seems to be coming from Gradle 8.5
Tried downgrading the Gradle version to 8.4 and 8.3, but no luck!