You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Jex Jexler (JIRA)" <ji...@apache.org> on 2016/05/07 20:32:12 UTC

[jira] [Commented] (GROOVY-7591) Use of ClassValue causes major memory leak

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

Jex Jexler commented on GROOVY-7591:
------------------------------------

This issue puzzles me, because I observe *exactly the opposite* when I run a script like

{code:java}while(true) new GroovyShell().parse('42'){code}

or 

{code:java}while(true) new ConfigSlurper().parse('72'){code}

and limit PermGen resp. Metaspace, say, to 64m, this crashes various VMs after about a minute with an "OutOfMemoryError: PermGen space|Metaspace"  in the following cases:

* Groovy 2.4.6, groovy.use.shareclasses=false (or not set) => *crash*
* Groovy 2.4.6, groovy.use.shareclasses=true => *works*, PermGen/Metaspace is garbage collected when it nears the configured maximum (resp. already earlier with JDK 9)
* Groovy 2.4.4 => *works, too* (as expected because is implicitly using shareclasses)
* (Groovy 2.3.9 => *crash* (except with JDK 9))

VMs I tested on include Oracle JDK 1.8.0_92 on Mac, Oracle JDK 1.7.0_67 on Mac, Oracle JDK 1.8.0_51 on CentOS 6.7 (64 bit) and Oracle/OpenJDK 9-ea+116 on Debian 7 (64 bit(.

So this behavior seems to be quite whitespread and note that "out-of-the-box" Groovy 2.4.6 fails here.

Is this a known issue?

> Use of ClassValue causes major memory leak
> ------------------------------------------
>
>                 Key: GROOVY-7591
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7591
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4
>            Reporter: Cédric Champeau
>            Assignee: Cédric Champeau
>             Fix For: 2.4.5
>
>
> Following the discussion at http://mail-archives.apache.org/mod_mbox/incubator-groovy-dev/201509.mbox/%3CCADQzvm%3DvCHR7c1-uaCMkEq7i58ofvvaUrnqHjiGxMp0YQFuc5w%40mail.gmail.com%3E
> And the JDK bug https://bugs.openjdk.java.net/browse/JDK-8136353
> We suggest to disable use of ClassValue by default until bug is fixed in the JDK. There's a system property which will let the user reactivate use of ClassValue: {{groovy.use.classvalue}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)