Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-11205

Groovy 3.0.13 to Groovy 4.0.13, I encountered a "Java heap space" error during the compilation process

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • 4.0.13
    • None
    • performance
    • None
    • openjdk version "17.0.6" 2023-01-17 LTS
      OpenJDK Runtime Environment Corretto-17.0.6.10.1 (build 17.0.6+10-LTS)
      OpenJDK 64-Bit Server VM Corretto-17.0.6.10.1 (build 17.0.6+10-LTS, mixed mode, sharing)
      WIN11

    Description

      I'm facing an exception after upgrading the groovy-all version used for testing in my Gradle project from 3.0.13 to 4.0.13.

      > Task :compileTestGroovy FAILED

      FAILURE: Build failed with an exception.

      • What went wrong:
        Execution failed for task ':compileTestGroovy'.
        > Java heap space

      The current temporary solution is to increase jvmArgs.

      jvmArgs = ['-Xms512m', '-Xmx1g']

      jvmArgs = ['-Xms512m', '-Xmx2g']

      I have created a validation project, analyzed the memory, and found an increase in memory usage for org.codehaus.groovy.ast.ClassNode in version 4.0.13, particularly when there are a large number of test classes.

      Attachments

        1. groovy_3_0_13_mem.png
          167 kB
          DuanHen
        2. groovy_4_0_13_mem.png
          167 kB
          DuanHen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              duanhen DuanHen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: