Java 6 made my life easier

A client has upgraded a server app (standalone, not in a container) from a 1.4 JRE to 6.1. It’s like day and night. Particular highlights:

Memory use

Normal memory use under 1.4 was around 300 - 400 MB. Now it’s 200 - 300MB. Granted, on modern systems that’s nothing, but if the system doubles in use (as predicted), that will be handy; more importantly, since adding more memory to a JVM doesn’t always work well (aggravating GC thrashing when you do run low on memory), it’s good to use less.

Garbage collection

Under high memory conditions the 1.4 JVM parallel garbage collect didn’t really perform that well. The collector would thrash, recovering memory only for it to be reallocated, released… meanwhile users would complain of significant (order of magnitude) degredation in response times. In 6.1 parallel GC Just Works. Even under low memory conditions GC happens aggressively enough that the app isn’t stalling any more.

What makes that really handy is that traditionally people caution against adding huge amounts of memory to the JVM; while it takes longer to hit your limit, it had always been the case that more total memory would make GC thrashing even worse when it happened. This may not be the case any more, and if it isn’t, we’ll be happy campers - the app in question isn’t amenable to running in a cluster of JVMs without major re-work.

Graceful Recovery

Under 1.4 the app would, if it hit max memory, never really recover. We could move users to DR and leave the production site alone for hours. Heap memory would never be recovered, performance would remain shit. In 6.1 not only does heap memory get handed back when no longer needed, but the JVM returns memory to the OS, which is a first.

All in all the 6.1 upgrade has been brilliant. It works as well as Sun advertised 1.3 would.

Share