OpenRewrite JVM heap space is exhausted

redacted redacted redacted

Hello,

which version of openrewrite have you used? I have not found it in information you provided

Josef

redacted redacted redacted

could you try to execute it like this

gradle "-Dorg.gradle.jvmargs=-Xmx8G" rewrite:run

if this fails as well, we are still investigating

Moin @alicia-secure-haze,

it seems like you are exceeding the available heap size even with 8GB assigned.

Can you try to exclude certain files or modules from your project, which wouldn’t be affected by the OpenRewrite anyways?

Your configuration could look similar to this:

rewrite {
    exclusion (
            "moduleA",
            "/moduleB/**",
            "**/*.json",
            "**/*.xml",
    )

    activeRecipe(
            'com.mgmtp.a12.dataservices.UpgradeDataServicesProperties_37',
            'com.mgmtp.a12.dataservices.UpgradeDataServices_37',
            'com.mgmtp.a12.uaa.openrewrite.UpgradeUaa_8_0',
            'com.mgmtp.a12.kernel.UpgradeKernel_29',
            'com.mgmtp.a12.workflows.UpgradeWorkflows_11_0_0'
    )
}

This way the rewrite could be configured to be less resource intensive by excluding certain files or directories.

OpenRewrite documentation about config options: Gradle plugin configuration | OpenRewrite by Moderne
The format for the exclusion paths follows this: FileSystem (Java SE 11 & JDK 11 )

redacted redacted redacted

Glad to hear that. We will investigate and follow up with this as well as providing proper documentation about it.