Java heap space error in uploading document through webservice - java

HI
I am uploading the documents through webservice into the server.. when i am uploading the <10MB file, it is working fine & it is >10MB it is thrown the following error in the console..
I had the using the following parameters in the eclipse..
-startup
plugins/org.
clipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
--256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
--512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss4m
-XX:PermSize=300m
-XX:MaxPermSize=300m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+CMSIncrementalPacing
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
I am getting error as
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
The file was uploading the server with 0KB..
Any one can help me resolve this issue
Thanks,
Murali

Why are you allocating so much PermGen space (--launcher.XXMaxPermSize --512m and -XX:PermSize=300m and -XX:MaxPermSize=300m)? Virtually nothing needs that much PermGen space. Most applications don't need more than 128M. If you have a server for a complex application that's meant to run forever then you may be justified in increasing the value to 256M. But 512M is unnecessary.
I would suggest reducing these three options to 256M (or even 128M), and then replacing -Xmx384m with -Xmx512m and seeing if that resolves the issue.

Related

Eclipse not increasing VM heap size as specified in .ini

Can someone help me out with this. I just simply cannot get the VM to increase beyond 1.8GB or some reason. This utility returns 64 and 1883242496 when run in Eclipse but returns the correct values when run from the command line (java.exe). The VM is 64 bits so should go past 1.8 GB.
public static void main(String[] args) {
System.out.println(System.getProperty("sun.arch.data.model"));
System.out.println(java.lang.Runtime.getRuntime().maxMemory());
}
Eclipse.ini contents below. Tried just about everything.
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
512M
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:\Program Files\Java\jdk1.8.0_66\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms6144m
-Xmx6144m
-d64
Thanks in advance
The configuration in eclipse.ini sets the memory used by Eclipse itself, it does not change the memory used when you run a program from within Eclipse.
You can change the setting for a particular program by opening 'Run > Run Configurations' and selecting your program in the 'Java Applications' section and add your arguments to the 'VM arguments'.
You can also set the default as shown in another answer.
Even by setting both to same heap size 6144m
-Dosgi.requiredJavaVersion=1.7
-Xmx6144m
-Xmx6144m
in eclipse.ini is not increasing the heap size for 64 sit but by passing argument for JVM using windows--> preference we can increase the heap size
You can try this:
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
6144m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms6144m
-Xmx6144m
-XX:+UseParallelGC
-XX:PermSize=6144M
-XX:MaxPermSize=6144M
-d64
Hope it will help.
I recently had a problem with loading projects in an eclipse program.
The error was related to garbage collection (GC).
When searching for a solution online, I noticed this is due to the memory allocation.
In Eclipse, as you may know, the ini file could be used to allocate minimum and maximum memory allocated to the program.
-Xms  Initial memory size
-Xmx  maximum memory size
When the value of –Xmx was changed to higher value 2048m, I expected the program to load all the projects without any problem.
But, I could see the same error.
When I looked into little further, there was a system variable _JAVA_OPTIONS with value -Xmx512M. This had overwritten the values in the ini file.
Reflection:
It is worth to also look into the system variables when the program does not reflect the values in the ini files.

one app shows Unable to execute dex: GC overhead limit exceeded GC overhead limit exceeded in eclipse

I have tried to read some of the questions answered on stackoveflow and changed eclipse.ini according to this:
Now every app is running properly except one. It shows this message:
Unable to execute dex: GC overhead limit exceeded
GC overhead limit exceeded
It forces eclipse to crash. Is there any other way to fix this or is this my projects problem ?
Thanks!
locate the
eclipse.ini
file in your Eclipse's installation directory. Then Copy and past the following content :
openFile
--launcher.XXMaxPermSize
1024m
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx1024m

Unable to execute dex: GC overhead limit exceeded in Google Play Services?

I am stuck in last two days and try to run the project and also i changed many values but still same error with google play services. i am using eclipse juno 64bit and using alot of APIs jar and projects google play services is one of them. This is my below file can any body help me please how to get rid of this dam problem. its waste my lot of time.
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.adtproduct
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=512m
-Xms512m
-Xmx1024m

Eclipse throws "Unable to create new native thread.". How to fix it?

I have a problem with Eclipse configuration and very often it throws me a message "Unable to create new native thread." and I'm prompted to restart Eclipse. I saw that there are many topics about this, but i did find anything to help me to solve my problem.
I use:
Eclipse Java EE IDE for Web Developers.
Version: Juno Service Release 2
Build id: 20130225-0426
Windows 7 Ultimate
Processor: Intel Core(TM) 2 Duo CPU T5870 # 2.20 GHz
Memory (RAM): 4.00 GB
System Type: 64-bit Operating System
My eclipse.ini file:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
F:/Oracle/Middleware/jdk160_29/bin/javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-server
-XX:PermSize=256m
-XX:MaxPermSize=256m
-Xss2m
-Xms1G
-Xmx1G
-XX:MaxGCPauseMillis=10
Can you try to adjust the Xss parameter? It controls how big the stack of each thread is, and with Xmx set to 1G giving 2 Mb for the stack of each thread seems too much for IDE threads in most cases.
Since you have 4G of RAM try changing:
-Xss2m
-Xms1G
-Xmx1G
with
-Xss512k
-Xms1G
-Xmx1512m
This should solve your issue or at least mitigate it a lot.
I also had trouble with Eclipse Luna on Fedora 20. I've read a lot about different memory options and still couldn't figure out the problem. It drove me crazy.
Finally I realized that by default, the number of processes a regular user can have on Fedora is very limited. Content of limits.d/90-nproc.conf:
* soft nproc 1000
Raising this to 5000 fixed my "Unable to create new native thread" problems.

To what size should i increase the size to avoid perm gen error?

While installing google app engine for eclipse i get perm gen error. I read that you need to increase the size of perm gen for eclipse from the config or ini file packed with eclipse. Currently it looks like this :
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
At how many places do i have to do the edit ? Where do i need to add ? And does 256 M mean MB ? To what size should i increase the size ?
You need to add one at the end of the ini file:
-XX:MaxPermSize=256m
Keep making this bigger until the problem goes away - try 128M first and see how it goes.
Yes, 256M means "256 megabyes". You may also use G for gigabytes.

Categories

Resources