Which collector to use
Which collector is really the best? The answer is that it depends a lot on the machine type and memory area allocations, for example. In the following table, we summarize some of the major benefits of each collector mentioned previously:
Collector |
When to use |
---|---|
Serial |
Single-processor machines and small heaps |
Parallel |
Multiprocessor machines and applications that require high throughput |
Concurrent |
Fast processor machines and applications with strict SLAs that require quick response times |
G1 |
Multiprocessor server machines with applications using large heaps (>6GB) and in need of minimal GC latency |
As you can see, the serial collector is not really an option for enterprise solutions of today.
Should your application be deployed on a multiprocessor machine and require to complete the highest possible number of transactions in a time window, the parallel collector is a good choice. This is the case for applications that perform batch processing activities, billing...