Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By gimbal2

Thread: Heap Size

  1. #1
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Heap Size

    Is there any way to change heap size permanently? I tried by changing the runtime parameters of java but it doesn't work?

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default Re: Heap Size

    I tried by changing the runtime parameters of java but it doesn't work?
    Care to share more information? How did you set the runtime parameters? What makes you think it "didn't work"?

  3. #3
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Re: Heap Size

    Cotrolpanel -> Java -> View -> RunTimeParameter . I searched it on google ... I used runtime class to find total memory .

  4. #4
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Re: Heap Size

    No one knows ???

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,050
    Rep Power
    6

    Default Re: Heap Size

    There is no way to do that and it makes no sense to have to do that - you want to control that from your application, not the system installation. Otherwise you have to instruct all people that want to run your application to change some setting somewhere.

    You will have to pass the proper command line property to Java (-Xmx); how to do that depends on how you run and deploy the application. It is going to be different for a client application, an applet or a webstarted application for example. You could for example use a jar wrapper tool to generate a bootstrapping .exe file in which the maximum heap space is hardcoded. Just remember that when you set it really high, your application will not run on systems where that amount of memory is not available.
    allaudin likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Re: Heap Size

    thanks ...

  7. #7
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,656
    Rep Power
    5

    Default Re: Heap Size

    Just curious what warrants a heap size change. Perhaps using soft references might be help mitigate the requirement.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  8. #8
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Re: Heap Size

    I was reading article on heap memory, thought to change heap permanently :) I think in almost all apps default heap size works fine . Isn't it ?

  9. #9
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,656
    Rep Power
    5

    Default Re: Heap Size

    Well, I have never had a problem with it. Of course it obviously depends on what you are doing. It can be pretty easy to chew up memory in iterative algorithms if you need to retain previous computations to help find future solutions. Like calculating a whole lot of primes.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. Deploying xmx heap size setting
    By dmna007 in forum Networking
    Replies: 2
    Last Post: 08-20-2012, 12:52 PM
  2. What is the default heap size of a java program?
    By guest_user in forum New To Java
    Replies: 8
    Last Post: 07-16-2011, 10:20 AM
  3. Heap size
    By newbiejava in forum New To Java
    Replies: 2
    Last Post: 08-22-2010, 11:59 AM
  4. get maximum heap size that can be allocated
    By gautam.aditya97 in forum Java 2D
    Replies: 3
    Last Post: 04-05-2010, 05:03 AM
  5. Java heap size
    By jmdrocks in forum Eclipse
    Replies: 2
    Last Post: 12-12-2008, 06: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
  •