Results 1 to 15 of 15
  1. #1
    senorbum is offline Member
    Join Date
    Aug 2009
    Posts
    76
    Rep Power
    0

    Default Claiming memory at start up

    Quick question: If explicitly setting max/min heap size = someValue, does the JVM lock get this memory from the OS at start up and lock it from outside use (other apps/JVMs/etc.) to ensure that it will have all the memory it requested?

    I am assuming it does, but some verification would be nice.

    Thanks!

  2. #2
    fxRichard is offline Member
    Join Date
    Dec 2008
    Posts
    64
    Rep Power
    0

    Default

    I would have to look into this to tell you 100% for sure but my assumption is that it does and the reason I would assume this is because you will get an error if you try to create a jvm with more memory than is available.

  3. #3
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    This is my understanding:

    The JVM requests the minimum memory for you app-- whatever is the default or that you set-- at startup from the OS, which could fail. If the app needs more memory at run-time, then the JVM requests another block of memory from the OS until the max is reached. If at any time the OS refuses to give memory, likely because it ran out, then it will throw an exception.
    Last edited by mrmatt1111; 09-03-2009 at 07:54 PM.
    My Hobby Project: LegacyClone

  4. #4
    senorbum is offline Member
    Join Date
    Aug 2009
    Posts
    76
    Rep Power
    0

    Default

    That makes sense.

    Also, I saw something yesterday or the day before that backs up this assumption as well.

  5. #5
    fxRichard is offline Member
    Join Date
    Dec 2008
    Posts
    64
    Rep Power
    0

    Default

    I am basing some of my assumptions off of using JNI, as I have written quite a bit of JNI where if you request to create a JVM with more memory than is available it will not be created, you will get an error in response.

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    The JVM spec has all those details and then some.
    It's also available online for free.

  7. #7
    senorbum is offline Member
    Join Date
    Aug 2009
    Posts
    76
    Rep Power
    0

    Default

    Quote Originally Posted by r035198x View Post
    The JVM spec has all those details and then some.
    It's also available online for free.
    I've seen misinformation in sun docs before so sometimes I like to get confirmation.

    But thank you for the wise remark.

  8. #8
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Quote Originally Posted by senorbum View Post
    I've seen misinformation in sun docs before so sometimes I like to get confirmation.
    ...
    Really? Care to share?

  9. #9
    senorbum is offline Member
    Join Date
    Aug 2009
    Posts
    76
    Rep Power
    0

    Default

    I've seen contradictory statements regarding the garbage collection algorithm used by default on server class machines. One place said that you had to enable a VM argument and another said that it was enabled by default. They were both sun docs referencing the same version.

  10. #10
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    You realize of course that your statements are useless without links to the documents?
    In fact the JVM spec does not impose any particular gc algorithm. A blank gc method is actually a valid implementation.

  11. #11
    senorbum is offline Member
    Join Date
    Aug 2009
    Posts
    76
    Rep Power
    0

    Default

    Quote Originally Posted by r035198x View Post
    In fact the JVM spec does not impose any particular gc algorithm. A blank gc method is actually a valid implementation.
    I said that I've seen misinformation in sun docs, not the specific document you are talking about. I'm not going to dig through the internets to prove to you that there can be gaps in documentation.

  12. #12
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    You don't have to dig through the "internets". You said yourself the errors where in the sun docs so search space is reduced drastically.
    Better not claims that you cannot prove.

  13. #13
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    senorbum, it was a good question. :)

    edit: i meant that the original post was a good question.
    Last edited by mrmatt1111; 09-04-2009 at 07:05 AM.
    My Hobby Project: LegacyClone

  14. #14
    senorbum is offline Member
    Join Date
    Aug 2009
    Posts
    76
    Rep Power
    0

    Default

    Quote Originally Posted by r035198x View Post
    You don't have to dig through the "internets". You said yourself the errors where in the sun docs so search space is reduced drastically.
    Better not claims that you cannot prove.
    I can prove it, and have to my coworkers when it was important at the time. It matters not if I prove it to you, nor do I care if you think I'm making it up.

  15. #15
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Quote Originally Posted by senorbum View Post
    I can prove it, and have to my coworkers when it was important at the time. It matters not if I prove it to you, nor do I care if you think I'm making it up.
    Like I said, without any links to prove it, your statements are completely useless. The problem with posting such strong points on the internet is that you mislead people who rely on posted information.
    If you don't have proof then please don't post such misleading things and let people continue to read the Sun documentation.
    I can't stop you from posting whatever you want but I will call it false to let others know the truth until you can prove otherwise.

Similar Threads

  1. Replies: 5
    Last Post: 03-20-2009, 10:04 PM
  2. Replies: 2
    Last Post: 08-21-2008, 07:33 PM
  3. Out of memory
    By mew in forum New To Java
    Replies: 1
    Last Post: 01-20-2008, 08:55 AM
  4. Memory
    By mew in forum CLDC and MIDP
    Replies: 0
    Last Post: 12-28-2007, 11:02 AM
  5. Consumption of memory
    By Daniel in forum Advanced Java
    Replies: 1
    Last Post: 07-06-2007, 09:11 PM

Posting Permissions

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