Results 1 to 3 of 3

Thread: Heap size

  1. #1
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Default Heap size

    Dear The Expert,

    is there any formula to calculate required heap size?
    and
    is there any method to refresh JVM after took long time processing? or any JVM fine tuning method?

    please advise

    thanks & regards

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    What you mean required heap size? You can find the available heap size and based on it you may take some decisions. But it should not be so critical stuff. And also you can find maximum and free memory at that time.

    Java Code:
    Runtime.getRuntime().totalMemory(); 
    
    Runtime.getRuntime().maxMemory(); 
    
    Runtime.getRuntime().freeMemory();

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    If you can clear-up what you exactly want to do it's much easier to comment. And also please note that check the spellings on above three line of code, I just wrote them in the forum editor...

Similar Threads

  1. get maximum heap size that can be allocated
    By gautam.aditya97 in forum Java 2D
    Replies: 3
    Last Post: 04-05-2010, 06:03 AM
  2. no heap space... need more heap
    By anupam.kumar in forum Advanced Java
    Replies: 3
    Last Post: 02-08-2010, 05:42 PM
  3. Setting frame size to the size of an image
    By Yoruichi in forum AWT / Swing
    Replies: 5
    Last Post: 04-22-2009, 05:37 PM
  4. [SOLVED] JAVA heap size problem
    By sreedevi in forum New To Java
    Replies: 3
    Last Post: 02-11-2009, 08:05 AM
  5. Java heap size
    By jmdrocks in forum Eclipse
    Replies: 2
    Last Post: 12-12-2008, 07:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •