Hi all,

probably not such a good time to ask, since many of those, that could answer this might be on JavaOne... but still

On the user list we got an interesting program that makes quite some problems to the jvm as it seems. The groovy program looks like this:

    println "Started"
    for(int i = 0; i < 100; i++) {
        print "."
        for (int j=0;j<100000;j++) {
            Container c = new Container()
            c.run()
        }
    }
    println "\ndone"

public class Container implements Runnable {
  public Container() {}
  public void run() {
    GroovyShell gs = new GroovyShell()
    Script script = gs.parse("")
    script.run()
  }
}

What happens is that gs.parse will create a new script and a new class every time. Now using our custom call site code this works fine. Using the indy port, it fails with a permgen error on any jdk7 before u40. On u40 this works fine again. In jdk8 this fails sometimes with a metaspace error, while in u40 it seems to work quite reliable.

The problem must be more than just creating many classes, because our custom callsite caching creates just as many classes for the scripts as the indy version does. What does not happen so much there though is code generated by reflection and of course non from indy. So I especially suspect the code cache here to be responsible for the problem, but I have no real basis for this. I lack the means to diagnose the problem further

Is there a way to make this work on older jdk7 vms? And is there a way for me to make this work on jdk8? Do others here have similar experiences?

bye Jochen
--
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

--
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jvm-languages+unsubscr...@googlegroups.com.
To post to this group, send email to jvm-languages@googlegroups.com.
Visit this group at http://groups.google.com/group/jvm-languages.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to