2

I have been helping a friend develop nodes in Knime. For those who don't know Knime is essentially a framework in Java that creates nodes that automate some "thing" you program them to do. Each node has 4-5 classes, and the workflows we are creating have sometimes 50-60 nodes.

I have been researching about PermGen and to my knowledge it is essentially a copy of the compiled form of each class/function for the program to use on runtime. If you have a large number of classes (which we do) then PermGen will run out of memory. Each time I set up a flow my Eclipse crashes, so I thought by decreasing the number of classes I could get it to run again, but now the same flows that were running a week ago are still getting PermGen Errors. I have looked into how to handle the problem but I am not sure which avenue to take and why.

All changes are for eclipse.ini

Adding PermGenSpace:

-XX:MaxPermSize=1024m

CMSClassUnloadingEnabled:

-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled

CMSPermGenSweepingEnabled:

-XX:MaxPermSize=128m 
-XX:+UseConcMarkSweepGC 
-XX:+CMSClassUnloadingEnabled

I understand the change of setting MaxPermSize and how it solves the problem and I can't see any negative effects, but I don't understand if the two other changes could effect my setup negatively.

How should I be approaching this problem?

Resource link:

http://www.javacodegeeks.com/2013/12/decoding-java-lang-outofmemoryerror-permgen-space.html

Tyler Blatt
  • 135
  • 10
  • 3
    try java8, it has no more permgen. When / how does the error occur? 1G permgen is a lot. You can look nicely at memory usage when you run`jvisualvm` that comes with the JDK and install the visualgc plugin. – zapl Dec 07 '15 at 20:17
  • 1
    I think you should increase the permgen space of the run configuration (in the VM arguments section), not the host eclipse platform. – Gábor Bakos Dec 08 '15 at 07:34
  • @GáborBakos How would one go about doing that? – Tyler Blatt Dec 08 '15 at 16:02
  • 1
    @TylerBlatt [Something like this](http://stackoverflow.com/a/26628080) would do the trick. – Gábor Bakos Dec 08 '15 at 16:18
  • @TylerBlatt This problem should go away with KNIME 3.x/Java 8. If you are running from the Eclipse SDK, then editing the eclipse.ini file will only change the permgen allocation for the SDK eclipse instance, not any debug instances @GáborBakos has linked an answer for that. If you are running into the problem in a standalone desktop version, you need to edit `knime.ini` exactly as you have described above for `eclipse.ini` – SteveR Apr 04 '17 at 09:01

0 Answers0