|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

05-23-2008, 12:28 PM
|
|
Member
|
|
Join Date: Jan 2008
Posts: 20
|
|
|
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... 
|
|

05-23-2008, 12:56 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-23-2008, 03:45 PM
|
 |
Senior Member
|
|
Join Date: Apr 2008
Location: Canada
Posts: 191
|
|
|
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.
__________________
Daniel @ [ To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. ]
Language is froth on the surface of thought
|
|

05-24-2008, 06:13 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Yep, DOM use a lots of memory. SAX not much. If your application is not a larger one, better to try it.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

10-30-2008, 08:28 AM
|
|
Member
|
|
Join Date: May 2008
Posts: 67
|
|
|
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.
|
|

10-30-2008, 09:47 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
I think he's clearly state that, to test on the command prompt.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

10-30-2008, 10:28 AM
|
|
Member
|
|
Join Date: May 2008
Posts: 67
|
|
|
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.
|
|

10-30-2008, 11:24 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

10-30-2008, 11:36 AM
|
|
Member
|
|
Join Date: May 2008
Posts: 67
|
|
|
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.
|
|

10-30-2008, 11:58 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

10-30-2008, 12:10 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 67
|
|
|
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.
|
|

10-30-2008, 12:15 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Config file is located at etc folder in the NetBeans installation folder. Option you have to change is netbeans_default_options
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

10-30-2008, 12:23 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 67
|
|
|
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.
|
|

10-30-2008, 12:45 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

10-30-2008, 12:55 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 67
|
|
|
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.
|
|

10-30-2008, 01:02 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
You mean after all those changes?
What's the total memory you have in your PC.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

10-30-2008, 01:06 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 67
|
|
|
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.....
|
|

10-30-2008, 01:14 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

10-30-2008, 01:22 PM
|
|
Member
|
|
Join Date: May 2008
Posts: 67
|
|
|
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.
|
|

10-30-2008, 01:27 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
 | | |