[ 
https://issues.apache.org/jira/browse/GROOVY-11205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17779104#comment-17779104
 ] 

Eric Milles commented on GROOVY-11205:
--------------------------------------

In order to support type annotations (JSR 308), references to "int", "Object" 
and so on in your sources have to be new instances rather than shared 
references.  There is a lot of state in a single ClassNode instance, most of 
which is for a type definition rather than a type reference.  GROOVY-11159 
discusses the possibility of separating the state somehow for purposes of 
memory savings.

>  Groovy 3.0.13 to Groovy 4.0.13, I encountered a "Java heap space" error 
> during the compilation process
> -------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11205
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11205
>             Project: Groovy
>          Issue Type: Bug
>          Components: performance
>    Affects Versions: 4.0.13
>         Environment: 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
>            Reporter: DuanHen
>            Priority: Major
>         Attachments: groovy_3_0_13_mem.png, groovy_4_0_13_mem.png
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to