3 Replies Latest reply: Dec 7, 2009 4:02 AM by 791266 RSS

    Can any java process exceed the maximum memory allocated

    843798
      Hi,

      I have a basic question on the memory settings. Assume I have a java process where the memory settings are like:

      -Xmx1024m

      where the server capacity is say 8GB Then can the process exceed the allocated memory of 1GB and go further say upto 4 GB.

      If above thing is possible, how can we limit the process not to exceed the given limit? What settings need to be used.
        • 1. Re: Can any java process exceed the maximum memory allocated
          791266
          Krish8 wrote:
          Hi,

          I have a basic question on the memory settings. Assume I have a java process where the memory settings are like:

          -Xmx1024m

          where the server capacity is say 8GB Then can the process exceed the allocated memory of 1GB and go further say upto 4 GB.

          If above thing is possible, how can we limit the process not to exceed the given limit? What settings need to be used.
          Yes the used memory can exceed that if you e.g. are using memory mapped files. Don't know if you can restrict it unless your OS has some kind of support for it.

          Kaj
          • 2. Re: Can any java process exceed the maximum memory allocated
            843798
            Thanks Kaj for your response. If yes, then what is the use of seeting max-heap size?

            Assume if set ParellelGC option in addition to this, does this stop exceeding the max limit?
            • 3. Re: Can any java process exceed the maximum memory allocated
              791266
              Krish8 wrote:
              Thanks Kaj for your response. If yes, then what is the use of seeting max-heap size?
              It's very seldom that you use memory mapped files, so the max allocated memory under normal conditions is the one that you specify.

              >
              Assume if set ParellelGC option in addition to this, does this stop exceeding the max limit?
              No, since the memory of a memory mapped file is allocated by the OS, and not "in the VM"