Which GC Policy should optthruput or gencon be? IBM websphere 7

I have a 4GB heap size allocated by the JVM.

why should i choose genconn GC policy for short lived object. As far as I understand, genconn will split the heap into two parts (nursery and lifetime), which will increase application response time but not throughput, since I will have enough heap size for my application. But if I'm only concerned about the bandwidth, I shouldn't use the optthruput policy so that I have fewer GC calls.

I can only think of one advantage of genconn to avoid disk fragmentation. Is there any other plus point for genconn for the above scenario.

0


source to share


3 answers


I'm not sure if I'm late adding some comments to your question, but I'll do it anyway. Since you already know the difference between optthruput and gencon, I'll cover the following aspects of these GC policies:

Heap memory usage

If your application has heavy traffic, you are likely consuming a lot of memory when using the optthruput GC policy, as the JVM will continue to allocate memory until it crosses the threshold, causing the garbage collection cycle to start.

In contrast, with the gencon GC policy, the JVM first allocates memory in a bunch of cells and also performs small GC cycles to remove unused objects from memory.

In my experience, overall heap usage with gencon can be reduced by 20-30%.



Pause time

The optthruput GC policy is "stop world garbage collection", it can be very costly and can lead to long pause times resulting in session or request timeouts. With the GC Gencon policy, you are unlikely to get a lot of pause time since most of the garbage collection is done before the full GC starts. The only downside to gencon is that it can run into fragmentation issues, but if your application is allocating a large number of short-lived objects than you are better off using gencon.

If you decide to use gencon, then please consider getting the GC verbose part with an optup first. You can easily set up the web sphere to spit out GC logs in the native_stderr.log file. You can use the GCMV eclipse plugin to extract GC logs into nice graphs and statistics.

Even after the description above, if you don't like gencon, then at least consider using the optavgpause GC policy. This can really help you avoid long pause times.

Hope this helps!

+3


source


Your best bet would be to actually enable verbosegc and test your application. There is no general rule and no policy is best for all applications. In my experience, generally gencon behaves better if configured correctly. When using optthruput, especially when using large heap sizes, you can have quite long pauses when the GC takes effect. These long pauses can lead to spikes in thread usage (because application threads are frozen), which in extreme cases can crush the server.

With gencon tuned most of the collections should only appear in the nursery, which are very fast. You should have very rarely or not at all. And usually the same application can use a much smaller heap with gencon than with optthruput



As I said, your best bet is to stress test and compare. You have a very good free Garbage Collector and Memory Notes tool , which is a plugin for another very useful tool for anyone working with WebSphere, the IBM Support Assistant .

This will allow you to import verboseGC log, show different graphs (like pause times, gc loops, etc.). This will allow you to compare your gc behavior and give general advice on how to tune it.

+1


source


I am running Java Service Engg at IBM Labs. Both politicians have their own trade. Policy selection is based on application requirement.

optthruput:

This policy can be considered when bandwidth is required.

How does Optthruput work?

The JVM allows objects to be distributed continuously until it reaches a threshold, i.e. (4% free java heap available). Once it reaches the GC threshold, it starts cleaning up dead objects. If the Xmx is huge, then there are possibilities for longer pause times, but before the threshold is reached, the application works fine. Example: Batching can be done efficiently using this policy.

GenCon: This policy is for less pause time.

How does Gencon policy work?

The Java heap is divided into children and training. Initial provision for a nursery. After it fills the nursery, the GC (Partial GC on Nursery area) collector occurs. This moves long-lived objects into the ownership area and keeps them in the nursery for a short time. After the system of filling the boxes and rooms is filled with the GC system, it begins to clean up dead objects.

If the nursery space is not set properly, gc flush occurs frequently, which halts the system. Excessive GC always results in system performance impact.

We hope this information will help you with your policy choices.

0


source







All Articles