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

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.

Related

How to change runtime JAVA heap space in intellij IDEA on MacOS?

I'm getting Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
when running some main object in scala with IntelliJ Idea,
with the "^R" shortcut or Right click-> run 'mainObjName'
This program runs without problem if using sbt:
$ JAVA_OPTS="-Xmx4096m" sbt
sbt:prj> run mainobj
With the search results got from this site, I tried to set the heap space to 4096m in :
1.Preferences->Build Tools->sbt->Maximum heap size,MB
2.Preferences->Compiler->Build process heap size(Mbytes)
3.Preferences->Compiler->Scala Compiler->Scala Compiler Server->JVM Maximum heap size,MB
4.Preferences->Build Tools->Maven->Runner->VM Options (with -Xmx4096m)
But none of these works.
I'm running a memory hungry program, and this is clearly not a build time error but some thing happened during runtime.
So, How to change the maximum heap size for running a program in IntelliJ Idea?
btw, the program runs fine on linux workstation with much more memory, but seems the default heap size configuration is the same on the IntelliJ Idea on MacOS vs Linux. seems java consumes more memory on MacOS?
It seems, that all the options you've tried are setting the memory for various compiler facilities.
You could try to change the memory available for the runtime by setting the VM options to -Xmx4096m in the configuration you are running. You can find the configuration with your mainObjName under Run -> Edit Configurations... -> Application

Heap out of memory exception

In my eclipse, while running a mapreduce program, it is throwing Out of memory exception
I tryied with changing the parameters in eclipse.ini (-Xms40m
-Xmx768m values to -Xms4000m
-Xmx7680m) but still getting the same error.
What would be the solution for this.
The eclipse.ini setting only sets the heap for Eclipse itself.
For a program you run from Eclipse look at the Run Configuration for the program and set the -Xmx value in the VM arguments.

Eclipse internal error

Today when i started my eclipse it gave me following error:
org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser:
input could not be parsed correctly at position 150449
java.lang.StackOverflowError
Then it shows another error
An internal error occurred during:
"JSP Index Manager: Processing Resource Events".
java.lang.StackOverflowError
and then show the error and when i click on yes button it close the eclipse,
I am using eclipse indigo, can any one help please.
Most typical reason for this error is that Eclipse or its part (e.g. source code parser) ran out of memory. To increase the memory, add/change the following parameters in eclipse.ini. Depending on your machine memory, increase them 4x, even 8x:
-XX:MaxPermSize=512m -Xss2m -Xms128m -Xmx512m
You can also use these parameters as eclipse command line parameters.
See details, for example, here: Understanding memory parameters for Eclipse
If memory changes in .ini does no do the trick , best way will be to close any other applications running , after that open Task Manager , and close JAVA services running . Restart the eclipse . NOTE :- This will close the programs using Java if they are open .

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

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.

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)