-
Java Heap Space
I am getting "Java Heap Space" Exception while trying to upload xml data into mysql database......I need help....
How to get rid of this "Java Heap Space"...
I tried to set Catalina_opts to no use.....
I also tried re-installing Java....
nothing worked...help me...:)
-
In simple word it's memory leak of your application. May be after updating your file still open and try to do the same again and again.
-
You can try to increase the amount of memory Java uses. to do this you have to specify parameters on the command line
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
Example: java -Xms64M -Xmx512M ....
This will start the JVM with 64 MB of memory reserved and will allow increase up to 512 MB. Of course you can specify more. If you are reading a big XML file with DOM that will consume lots of memory. You can also try SAX (if you don't already)
I guess you are using Tomcat. In this situation you have to look at Tomcat startup scripts and modify the way Java JVM is started with the parameters I specified.
-
Yep, DOM use a lots of memory. SAX not much. If your application is not a larger one, better to try it.
-
Hi DanielStoner,
How to increase my java heap size using the command given by you. is it ok to run the command from command line... or i should set classpath for java. Please guide me to solve this issue. Due to low memory my system start up is very slow and it takes huge time to open any application. Also i face java heap space problem.
Regards,
Prabhu.
-
I think he's clearly state that, to test on the command prompt.
-
Hi Eranga,
Great day to you.
I have done as said by DanielStoner, but nothing is happened. If i try that command through command prompt, it is displaying the options command screen. Also i have administrator rights.
Regards,
Prabhu.
-
What you mean by options command window. If that command fail error message is prompt. If not, I think anything is not displayed to the screen.
-
Dear Eranga,
When i type the command given by daniel, im getting the list of options for shortcut key commands. If you are not clear. Ok we can stop here. However eranga, if i run the command, i could not see the process done, instead is there any other way to increase the heap size of java, im using netbeans ide, when opening the ide i face this issue.
-
Once someone doesn't clear what you say, doesn't mean that discussion should be stop. ;)
Since you are working on NetBeans why are you worrying about those things? Use the NetBeans configuration file.
-
Hi Eranga,
Sorry i did not mean that way. I do not know how to let you know the things happening for me thats why i said like that. Im ready to have discussions a lot with my seniors like you.
If i use netbeans, we can configure the java heap size for it. Ok if so, i will work on it and let you know.
Regards,
Prabhu.
-
Config file is located at etc folder in the NetBeans installation folder. Option you have to change is netbeans_default_options
-
Hi Eranga,
netbeans_default_options="-J-Xms512m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"
I have increased the maximum and min. size to 512, before it was mini. 32m and maxim. 128m, but should i have to increase the permSize also to that extent or let it be as such, or shall i increase the permSize and MaxPermSize to to some extent.
Regards,
Prabhu.
-
Increase MaxPermSize only. And also you can decrees Xms as well, but it can cause UI responsive issues if the OutOfMemory reach. In that case you have to increase it again. You can keep PermSize as it is, that amount is fine work out smoothly.
-
Thank you very much Eranga, for guiding me. However while start-up my pc is very slow, so i have formatted my os, and for the next three days everything went fine, but again now it is very slow to boot-up. Can you please let me know the reason for it. What shall i do to rectify this situation.
Regards,
Prabhu.
-
You mean after all those changes?
What's the total memory you have in your PC.
-
Before making these changes, i was facing this issue. I have a 2GB Ram size. But even now i noted it after shuting down my pc and logging again, it is taking more time to boot-up.....
-
This type of issue can cause because of the maximum size you have allocated to NetBeans. Logically it cannot happen, since you don't have open NetBeans. But practically it happen because page file keep those records at the system shutdown. Then when you boot up again, located memory for boot-up can be not enough. May be you have lots of application to run at startup.
Seems that your PC have an issue too, I wonder since you have 2GB or memory NetBeans giving such heap size issue.
-
I can understand eranga, is there any solution to get rid of these performance issue. While start up of my pc. But i could not understand why it was working fine when i formated my os and for next three days it was booting up fine and now it gets slow.
-
Lots of reason is there. But the reason is we cannot talk technical stuff here in our community. Because we are looking around with Java technologies.