2

I have some questions about setting permsize, xmx and xms values in java. These are:

  1. Default size of permgen size is 64 MB. Not sure how much default is defined for heapsize?

  2. How much maxpermgen and xmx values are permitted for a given RAM (2gb/4gb)?

  3. Should I keep xmx and xms parameter equal or not? What is the benefit of keeping them diferent?

  4. Should I keep XX:permgensize and XX:maxpermgensizeparameter equal or not?

1 Answer 1

2

.1. The default maximum heap in Java 6 is 64 for the client JVM and 1/4 of the memory or 1 GB for the server JVM.

http://download.oracle.com/javase/6/docs/technotes/guides/vm/gc-ergonomics.html

.2. The maximum sizes for the 64-bit JVM is limited by the available memory.

.3. Using a lower minimum means it can use less memory if it doesn't need it. If you know exactly how much memory you want the heap to use, you can set both to the same.

.4. Again, if you know exactly how much you want it to use, make them the same. If you would like it to use less if its not needed, just set the maximum.

Unless you know you need to set these parameters, I wouldn't. I would let the JVM workout what a good value is.

Sign up to request clarification or add additional context in comments.

4 Comments

Regarding point 1, note that this is for server-class machines, not any machine. For machines that are not classified as server-class by the JVM, the default is in fact 64 MB.
@JRL, Good point. I keep forgetting the client JVM exists. In 12 years I have not used it. ;)
I need a bit clarify on question 3 & 4, it seems to be different from this thread mention: java-monitor.com/forum/showthread.php?t=427 We should not use: -Xms = -Xmx
@mtr You should not set any tuning parameters you don't need to. Often I see people setting parameters which are the default or might not be very helpful. Sometimes the minimum set of parameters is none at all. Often you might want to set -Xmx, which is also -mx, in production

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.