Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





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.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-16-2007, 05:57 PM
Member
 
Join Date: Jul 2007
Posts: 26
paul is on a distinguished road
java.lang.OutOfMemoryError: Java heap space
I'm working with a small application that runs multiple threads and potentially can get caught up in a very deep recursive process...
Everything works fine and, obviously, as the recursion gets deeper the execution time is increased...

Each time the recursive method is called it sends output to a text area that can be saved at the users request.

Once the program fills the text area with approximately 212000 lines it crashes and gives me a
Code:
java.lang.OutOfMemoryError: Java heap space
Is there a way I can monitor the Heap space being used (in real time) and detect when it reaches a certain point and have things fail a little more gracefully?

Upon "googling" for a solution I came across this page which gives an example of a OutOfMemoryError Warning System. This sounds like exactly what I am looking for but I can not get it to work for me...it's not much of a tutorial.
Thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-25-2007, 09:07 PM
Member
 
Join Date: Jul 2007
Posts: 55
Seemster is on a distinguished road
Increase the heap size as such:

-Xms256m -Xmx512m -XX:PermSize=64M -XX:MaxPermSize=1000M

These values should be provided to the VM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Heap Sort in Java Java Tip Algorithms 0 04-16-2008 11:27 PM
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String) baltimore New To Java 1 08-06-2007 08:45 AM
java.lang.OutOfMemoryError with java vector mary New To Java 3 08-03-2007 11:55 AM
Java Heap Out of Memory Error stonkers New To Java 3 07-17-2007 05:43 PM
java.lang.UnsatisfiedLinkError: no parport in java.library.path Heather NetBeans 2 06-29-2007 03:45 PM


All times are GMT +3. The time now is 02:36 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org