flexmojo java heap space error - java

When I lunch maven flexMojo compile plugin from eclipse in windows OS I get java heap space error .
any idea on increasing memory for maven ?
I tired this in windows envirement variables :
MVN_OPTS = -Xmx1024m -XX:MaxPermSize=512m
and it didn't help .

Shouldn't this be MAVEN_OPTS instead of MVN_OPTS?

Some one post the answer in the web . a copy paste from the original post :
The solution obviously is to increase the maximum heap size which is represented by the JVM -Xmx argument. Now there are a number of places you can find this argument (STS.ini is one of them) , but here's the one place I found that really makes the difference.
Goto the 'Run Configurations' popup of the current maven run you are trying to use (can be accesed by right clicking your project and selecting 'Run As')
Select your current run under 'Maven Build' in the tree
Select the the JVM tab and add your requested -Xmx settings (I chose -Xmx512m)
Press 'Apply' and 'Run'

Related

NetBeans Low on Memory Error

I am new to this kind of error in Netbeans. I have been working in Java J2SE using my net beans 8.0.2. I am doing Fuzzy Search on Strings usually strings having 300-500 length. I am using Levenshtein and Jaro Winkler Algorithms to find the Distance between the strings.
There are about 1500 iterations to find the distance between the strings!
The problem is that my net beans often gives error for:
Low on Memory, Error Unable to Compile
I have done some search online to get rid of this error and found how to increase the heap size by adding
-Xms3G
command means to give 3GB space for the heap! but the error still comes up in the compilation process and project run in net beans.
Can somebody help me out how to get rid of this error because when it happen i got this error
java.lang.noClassDefError
Please help me getting rid of this error I am a newbie for this error!
With -Xms3G, it means that your JVM will be started with Xms amount of memory, the initial memory allocation.
But instead use -Xmx3G which will be able to use a maximum of Xmx amount of memory, the maximum memory allocation.
1.Netbeans Heap Size
If you want to increase the NetbeansIDE heap size, then edit the following file.(the etc folder from your Netbeans installation dir)
C:\Program Files\NetBeans\etc\netbeans.conf
Find the following line and add -J-Xmx3G, you can specify any size. I have provided 3G for eg.
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Xmx3G -J-XX:PermSize=32m ......."
2. Project settings for running a project by increasing Heap size from Netbeans
Right Click Project -> Properties -> Run -> VM Options -> Customize Button.
You will find many options for VM, specify value for Xmx.
3. Run a jar file by providing VM options to increase heap size, outside of Netbeans.
Run form command line or write a script.
java -Xmx3G -jar filename.jar
Hope this may help.
The simplest answer for my problem was a trick to identify. I had a number of netbeans projects into my working directory. Suppose that my directory D:\NetBeans\WorkSpace contains about 300 projects!
What I done is that simplify the directory moved the old projects into a new directory and only a few projects left into my netbeans working space.
The error message goes off after moving a number of projects into a new directory.
The thing is when netbeans starts up it loads the projects into the memory and if you have a lot of projects into the loading directory it will cause to leak the memory!
Allocate more memory for NetBeans.
Go to your NetBeans home directory.
Open the netbeans.conf file in the etc directory. //under:Resource/NetBeans/etc
Find the netbeans_default_options parameter in the file.
Set the -J-Xms and -J-XX to larger values. ex:-J-Xms256, -J-XX256
Hope for help.

how to fix eclipse gc overhead error when launch android application second time

i am facing problem in my eclipse ,when i am launch my android application second time it shows error message . Eclipse GC overhead (Heap memory overhead)
Right click on the project
select RunAs
Run configurations
Select your project as BaseDirectory. In place of goals give eclipse:eclipse install
In the second tab give -Xmx1024m as VM arguments.
Another easy way to do this is
open eclipse.ini and increase the Xms (heap’s start memory) and Xmx (heap’s maximum memory) values to a value that you think is reasonable with your system and projects, for example:
-Xms512m
-Xmx1024m
Try this.Let me know if problem still occurs

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space on eclipse

I am trying to execute this program using fork and join framework. When I feed a JPEG image of smaller size to this program it works fine, but when I give the image of size more than 4 MB it throws below exception:
****Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at ForkBlur.blur(ForkBlur.java:120)
at ForkBlur.main(ForkBlur.java:110)****
I am using eclipse Helios IDE.
I want it to work for larger images of size more than 50 MB
It worked fine for me .
Right click on project which you want to run . Run As -> Run configuration ->Arguments .
Then in VM arguments:
-Xmx1g
You'll need to tell the JVM to allow for more memory for your program. If running the program from the command line, you would use the -mx option to specify how much memory the JVM is allowed to use.
For example, to allow for 128MB of memory, you would do:
java -mx128M MyClass
If running from Eclipse Helios, do this:
Right click on the project and go to properties.
Click on Run/Debug Settings.
Choose your run configuration and click Edit or click New to create one using the Java Application configuration type.
On the Arguments tab, put -mx128M in the VM arguments box.
You need to specify a bigger heap size when you run the program.
You can do it via eclipse if that's your preferred tool. You can right click on the file containing the main method, choose the option "Run As" - this would open up a dialog where you can set up host of command line options (look for arguments section).
The command line option to configure the maximum heap size is Xmx; an example would be Xmx 2g to set the maximum heap size to 2 gb.

Help setting up Java VM size

Well I am very new to Java and can't understand how am I supposed to set the virtual machine's size. I've built a small web applet that displays images. Sometimes the images can be pretty large, when this happens I get:
*Exception in thread "Image Fetcher 0" java.lang.OutOfMemoryError: Java heap space*
I've been trying to follow different instructions that I found on the Internet and have finally created this shortcut to Eclipse with the following command-line:
"C:\Documents and Settings\Dror Well\Desktop\temp\Eclipse\eclipse\eclipse\eclipse.exe"
-vmargs -vm "C:\Program Files\Java\jdk1.6.0_14\bin"
\"C:\Program Files\Java\jre6\bin\javaw.exe" -Xms256m -Xmx1024m
What am I missing? How should this be done?
In that line you have set the VM args to the Java process that Eclipse runs in. What you need to do for your application is to set the -Xmx512m (or however big you want it to be) for the application that you are running. You can do this from the Run dialog.
From the Run menu, choose 'Open Run Dialog'. In there, you should see on the left side a list of programs. If you have run it once already, yours should be listed in the Java Applications node. Select it and on the right panel, go to the Arguments tab. There will be a VM Arguments text box. Enter your -Xmx arg there.
The parameters should be passed to the JVM running your application, not the one running Eclipse. Try looking through the debug settings in Eclipse, there should be some place to put the -Xmx and -Xms parameters.
Since the images can be pretty large, you should look at the following alternatives:
Allocate more memory to the Java executable that will be launched by Eclipse (not Eclipse itself). This can be done via the VM arguments for the runtime configuration that you use to run the application in Eclipse.
Switch to the parallel garbage collector, using the -XX:+UseParallelGC flag for the application (again, this is not for Eclipse). This wont help if you have large objects retained in memory for a long period of time.
For Eclipse you need to update the eclipse.ini file in order to set any JVM properties. Full details on where the file is and how to update it this link.

OutOfMemory in Eclipse in a Launched process

I have an OutOfMemory (heap size) in eclipse using a third party plugin
The plug in is Adobe Livecycle work bench and during the out of memory the
plugin is retrieving via WS (using Axis) a list of around 70 workflow components
on my server
Here is a extract of my call stack in Eclipse
... at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
Caused by: java.lang.OutOfMemoryError: Java heap space; nested
exception is: java.lang.OutOfMemoryError: Java heap space at
org.apache.axis.message.SOAPFaultBuilder.createFault ...
I am using this eclipse.ini
-showlocation
-vm
C:\bea920\jdk150_04\bin\javaw.exe
-vmargs
-Xms512M
-Xmx1024M
I don't use any commandline options
I have added -Xmx1024m to my only Installed JRE in Java/Installed JREs
It seems to me that :
-eclipse is not OutOfMemory itself
it displays only 300Mo out of 1024Mo used
it continues working properly
-the plugin launch its axis parsing without giving it enough memory
Questions :
- Are my suppositions right ?
- How do I find where and how to give more memory to the process launched by eclipse launcher ?
Have you changed your launched VM arguments from the preferences window? Try this:
Window->Preferences
Java->Installed JREs
(select your jre here)->Edit..
Default VM Arguments: -Xmx1024m (or whatever size you like)
Edit 1: Based on your comments, I see that you've already tried this. I assumed that you did not try it based on the portion of your question that reads "How do I find where and how to give more memory to the process launched by eclipse launcher ?". I guess we all know what happens when we assume!
Have you considered upping the memory to something larger just to see if you can get it to run (and possibly get some more info about what is causing it to crash)? Try -Xmx2048m or larger depending on your available memory.
Can you add some information to your question that gives us an idea of what the plugin does? Is this project a web service? etc..
See if you are passing Xms and Xmx options in the command line that you are running eclipse with. The values there will override the values in the eclipse.ini
I think you need to edit your eclipse.ini file which is located in the
same directory as your eclipse exe file. It will contain the -Xms settings
which you can then change.
I recommend running eclipse with the -clean option to purge any caches and re-read your settings.
Also, I've had success moving the eclipse.ini out of the eclipse directory (so there's no eclipse.ini), running eclipse, exiting, moving the ini file back and running again. I didn't bother to try to understand why that helped.
Add -XX:MaxPermSize=256m
This is yet-another-memory-type in Java.
I was able to find were the problem is
I used Fiddler with eclipse (using proxy settings)
This way I was able to spot that the soap answer was an OutOfMemory
soapenv:Fault
faultcode soapenv:Server.generalException
faultstring java.lang.OutOfMemoryError: Java heap space; nested exception is:
java.lang.OutOfMemoryError: Java heap space
So the problem was on the server
I have now another problem : the server builds an answer which is to big for eclipse
Thank you for your answers

Categories

Resources