Runtime.getRuntime().maxMemory() = -Xms + -Xmx

Discussion in 'Java' started by Wenbo, Jun 21, 2004.

  1. Wenbo

    Wenbo Guest

    It looks to me that Runtime#maxMemory() never returns -Xmx, which is
    mentioned at many places .. even Sun's document (not javadoc or spec
    though)..

    From what I saw, it is actually equal to the sum of -Xms and -Xmx runtime
    settings ..

    I am using Solaris 1.4.2 .. JDK .. and am I missing anything here?

    - Wenbo
     
    Wenbo, Jun 21, 2004
    #1
    1. Advertising

  2. Wenbo wrote:

    > It looks to me that Runtime#maxMemory() never returns -Xmx, which is
    > mentioned at many places .. even Sun's document (not javadoc or spec
    > though)..
    >
    > From what I saw, it is actually equal to the sum of -Xms and -Xmx runtime
    > settings ..


    I don't think so. Note that the -Xmx parameter just specifies the size of the memory
    allocation pool from which objects (and maybe thread stacks) are allocated, but
    NOT the space the JVM itself takes. The latter may conincide with your -Xms setting
    but should not vary.
     
    Michael Borgwardt, Jun 22, 2004
    #2
    1. Advertising

  3. Wenbo

    Wenbo Guest

    You're probably right .. the maxMemory always adds 64MB to -Xmx on the
    Solaris 1.4.2 JDK implementation ...


    "Michael Borgwardt" <> wrote in message
    news:...
    > Wenbo wrote:
    >
    > > It looks to me that Runtime#maxMemory() never returns -Xmx, which is
    > > mentioned at many places .. even Sun's document (not javadoc or spec
    > > though)..
    > >
    > > From what I saw, it is actually equal to the sum of -Xms and -Xmx

    runtime
    > > settings ..

    >
    > I don't think so. Note that the -Xmx parameter just specifies the size of

    the memory
    > allocation pool from which objects (and maybe thread stacks) are

    allocated, but
    > NOT the space the JVM itself takes. The latter may conincide with

    your -Xms setting
    > but should not vary.
     
    Wenbo, Jun 22, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frank D. Greco

    Runtime memory methods and -Xmx/Xms?

    Frank D. Greco, Jul 17, 2003, in forum: Java
    Replies:
    1
    Views:
    1,355
    dhek bhun kho
    Jul 17, 2003
  2. Ahmed Moustafa

    When to use -Xms and -Xmx?

    Ahmed Moustafa, Sep 10, 2003, in forum: Java
    Replies:
    3
    Views:
    449
    Ahmed Moustafa
    Sep 10, 2003
  3. Ben_
    Replies:
    1
    Views:
    4,934
  4. Replies:
    8
    Views:
    16,342
    Arne Vajhøj
    May 12, 2009
  5. Tom Anderson

    Should -Xmx be a multiple of -Xms?

    Tom Anderson, Jun 1, 2010, in forum: Java
    Replies:
    11
    Views:
    921
    Mike Schilling
    Jun 3, 2010
Loading...

Share This Page