Many people complain that Java applications are anti-social when it comes to the overall operation and management of the system on which they execute. Do Java applications get along with the other kids in the playground? The answer is Yes and No. Yes they can depending on the application, how the application works and more importantly how the system is configured and No they don’t when you expect them to behave like applications written in C.
The most vocal complaints about Java applications revolve around suggestions that Java applications are bloated from a memory utilization perspective. So, why is it this way? It’s really not easy to find accurate definitive answers to this if you’re searching the web, however the root cause seems to be that the JVM doesn’t return memory from the heap back to the operating system even after garbage collection has occurred. This would be a requirement in some cases, such as an embedded JVM that may not have an underlying OS to return memory to, however with a sophisticated OS supporting the JVM I think memory should be returned to allow the OS more options in application workload management.
Admittedly there are some posts around that suggest that there have been improvements in this area but the current position is best illustrated by the following bug report . It’s particularly interesting to note the workaround which I personally don’t find inspirational and it certainly doesn’t consider all of the possible problems with all OS’s if you follow the advice blindly 😦
The RFE is still open and has been since 2002 – again not awe inspiring. Now that Java has been open sourced hopefully we’ll see a JVM that releases memory back to the OS rather than relying on OS based working set management – then maybe java wont get so many bloody noses when it ventures out into the playground.
Does this apply to all JVM’s? How much improvement has there actually been since 2002 and is it quantifiable? I don’t know – still looking.