java.lang.OutOfMemoryError: PermGen space with Resin and EclipseLink - eclipse

Ever since I added EclipseLink to my setup I keep getting memory errors every few minutes. It really sucks because Eclipse (IDE) can't even stop resin once that happens and I have to go to the command line to kill it.
The error is usually this:
Unable to load class: java.lang.OutOfMemoryError: PermGen space
In my resin.xml I have the following hoping to correct the issue but it doesn't help:
<server-default>
<jvm-arg>-Xmx512m</jvm-arg>
<jvm-arg>-XX:MaxPermSize=1024m</jvm-arg>
<jvm-arg>-Xss1m</jvm-arg>
<jvm-arg>-XX:+CMSClassUnloadingEnabled</jvm-arg>
<jvm-arg>-XX:+CMSPermGenSweepingEnabled</jvm-arg>
</server-default>
The last two lines are the last thing I tried and it failed quickly.
Any suggestions?
Thanks.

So far a change I made has helped: I put -XX:MaxPermSize=1024m in the Eclipse server launch configuration - vm arguments.
Someone from Caucho told me that when using Eclipse the -X arguments in resin.xml are not used, so that makes sense.

Related

How to set -J-Xmx parameter in PyDev Eclipise for Jython

When I run the program from PyDev/Eclipse, it runs out of memory and gives the following error:
java.lang.OutOfMemoryError: java.lang.OutOfMemoryError: GC overhead
limit exceeded
It goes away when I pass the -J-Xmx2048 limit from the command line. So clearly, this can be solved if PyDev can read these somehow.
In Eclipse, I tried setting this values in the run options (in eclipse) as program & vm arugments, but I get the same error. I also tried setting the JAVA_MEM option, but that doesn't help either.
Any ideas how I can instruct PyDev/Eclipse to read these arguments?
It turns out that the Run As -> Run Configurations -> Arguments -> Vm Arguments for Jython also expect Java arguments and not Jython ones :/
Setting the VM arguments to -Xmx2048 fixed the issue. The memory usage for java now peaks to 2G (earlier 1G) confirming the fix.

GWT compiler is running out of memory. How do I configure it within IntelliJ?

I'm running GWT from within IntelliJ. (Plain GWT, IntelliJ v9). I'm able to run my application via my "GWT development mode" configuration, but when I try to run it through my "local tomcat" configuration, I get a bunch of incomprehensible error messages referring to Oracle and all sorts of weird stuff that I don't use, followed by this error which is sorted to the bottom of all the others:
Error: Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)
I'm guessing that this error is the root cause.
According to my understanding, there is a GWT compilation step which runs in a JVM separate to both IntelliJ and tomcat, and so I'm unsure where to set the -Xmx parameter.
My question is: where do I find this -Xmx parameter? (And: am I on the right track, taking this error message at face value, or is it a symptom of deeper problems?)
You can configure the heap in the GWT facet settings:
As CrazyCoder just said you can increase the amount of memory for gwt compiler in the GWT Facet settings. The GWT Compiler running out of memory on bigger apps is very common if you don`t increase the amount of memory. Most projects should be fine with 512m, but on large projects I already needed more memory.
So this is not some out of memory error caused by some bad design on your behalf.
In my application, I set it to 1024 but it gives me out of memory after 7-9 page refresh on dev mode. And after that I tried it to optimize by doing performance hack, I separated my *.gwt.xml for every gwt module for specific browsers by setting:
MySampleModule_FF.gwt.xml
<set-property name="user.agent" value="gecko1_8"/>
And I run my dev mode with this gwt.xml for Firefox. In addition to it also separated internationalization as well.
After that my out of memory issues considerably decreased.
32 bit JDK also sometimes causes Out Of Memory error. Try using 64 bit JDK.
To those who get the same error under Eclipse, try to restore cache files (if they were removed accidentally in WAR folder ), this way I solve the same problem under my Eclipse project.

Eclipse CDT: org.eclipse.cdt.internal.ui.text.CReconciler, java.lang.OutOfMemoryError

I can run Eclipse with CDT for about 15 minutes before it crashes with a java heap space out of memory error. Its always associated with the org.eclipse.cdt.internal.ui.text.CReconciler thread. It's gotten to the point where I'm running on auto pilot when it happens: "rm .lock", "y", "eclipse&" and away I go. I can't find relevant information with the Google nor have I found a similar post on SO. Anyone else run into this kind of issue before?
I'm using
Eclipse 3.6.1, Build ID: M20100909-0800
CDT 6.1
Subversion 2.2.1
Pydev 1.6.3.2
OS: Red Hat 2.16
Intel quad core machine, single monitor
I don't have root access. I don't know what other information someone might need to help diagnose this. IT person has tried to find more information but even he doesn't know what's going on. This is not strictly an issue with just my computer either.
It is possible that you need more heap space than the default Eclipse setting provides. Try launching Eclipse with 1G of heap by editing eclipse.ini and change the line starting with -Xmx to
-Xmx1024m
Alternatively you can launch from the command line with
eclipse -vmargs -Xmx1024m
[UPDATE - probably should have been suggested first ]
Tail the log file at _<workspace>_/.metadata/.log to see if there is any recurring event or error that might be leaking memory.

What could cause EasyEclipse to terminate with error window?

When I start EasyEclipse, I get error:
JVM terminated. Exit code=127
Do you have any idea as to the possible cause for this kind of error message?
If this happen right from the start, it may be related to your eclipse.ini content.
See this one (for Eclipse 3.6 Helios),
and check the end of each lines of your eclipse.ini: there should be no extra space.
After that, it depends on:
the exact Eclipse version
the exact JVM used to launch said Eclipse
your platform (OS)
See for instance bug 174642.

Out of Memory error starting JBoss with Portal from Eclipse

I cannot get JBoss Portal to start from Eclipse, though the AS alone starts fine, and the Portal starts correctly as well, when started from the command line as opposed to from within Eclipse. I'm running in Windows, with 3GB. Suggestions? Thank you.
I've spend hours to discover this, and almost gave up and started to use JBoss out of Eclipse.
In order to increase your JBoss vmargs when starting it from Eclipse you have to change JBoss launch configuration. If you change standalone.conf, nothing happens because Eclipse doesn't use it.
So, to change JBoss vmargs in Eclipse, you have to go to "Servers" tab, right click on your Jboss instance, and select "Open".
It will appear a new window. In the first section, you have a option: "Open launch configuration". When you click there, you'll see the textbox to change vmargs.
Hope this helps you!
There are different types of OutOfMemory errors:
java.lang.OutOfMemoryError: Java heap space
Increase the -Xms and -Xmx. I'd make sure they are set at least 256m and generally it's a good idea to set them to the same value.
java.lang.OutOfMemoryError: PermGen space
Add either -XX:+CMSPermGenSweepingEnabled or increase the PermGen size: -XX:PermSize=256m
java.lang.OutOfMemoryError: GC overhead limit exceeded
Add more heap, the garbage collector can't free enough memory with each cycle. Also try turning on GC logging.
java.lang.OutOfMemoryError: unable to create new native thread
Decrease your heap :) This means that you have too much memory allocated to the heap that the OS doesn't have enough memory to create threads..
Two last things, the above can be configured in jboss/bin/run.conf.
Also when starting JBoss see what -X parameters are being passed to the JVM, it prints this information by default, verify that it's what you expect it to be.
You need to increase the memory you're allocating to Java, in particular heap space and PermGen. This article is highly relevant. It mentions that this issue often occurs with Eclipse and JBoss (since both are fairly large), and provides a solution (adjusting the command-line flags).
What are you using for running portal from eclipse? Maybe Jboss tools can help you
http://www.jboss.org/tools
According to my experiments, all options of vmargs set in eclipse.ini, plays only once - when creating a new workspace. When you want to change the options in the existing workspace, use run/debug configuration as in https://stackoverflow.com/a/10814631/715269. vmargs in ini won't be read any more.
Be careful, you should set -XX:MaxPermSize=...M, not -XX:PermSize=..., the last sets minimal, starting PermSize.
ad. Jeremy. It is senseless to put mins and maxs to the same value. You deprive Eclipse of adaptability. -Xms and -Xmx ( heap) and PermGen and MaxPermGen should be different. (MaxPermGen =256 by default)