Search code examples
javaperformancegarbage-collectionjvmjvm-arguments

JVM performance with these garbage collection settings


I have an enterprise level Java application that serves a few thousand users per day. This is a JAXB web service on weblogic 10.3.6 (Java 1.6 JVM), using Hibernate to hit an Oracle database. It also calls other web services.

We have it tuned the following GC settings on our production system:

-server -Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=512m

What is the effect of this GC sizing? The hardware has more than enough capacity to handle it.

I know that this sets the heap size and perm gen at a stable level. But what's the impact of that when you eventually have to do garbage collection?

To me it seems that it would make GC happen less frequently, but take longer when it does happen. Does that sound correct?


Solution

  • it would make GC happen less frequently, but take longer when it does happen

    It might, it depends on your use case. You might even find that the GC is shorter in rare case.

    A 2 GB heap isn't that much and I would use up to 26 GB without worrying about heap size. Above this size memory accesses are a little slower or use more memory.