Tutorial Thursday

7 Reasons to love JBoss AS7 - Part 3


2) Exceptionally lightweight

We like to say that JBoss Application Server 7 lives on a memory diet. The JBoss Application Server 7 team is proudly “militant” about CPU and memory usage during the startup and deployment processes by taking an aggressive approach to memory management primarily to minimize garbage collector pauses. As they say, it’s all about making good choices starting at the design phase.

While garbage collection is a valuable feature of Java, it’s not particularly fast when given a lot of garbage to chew. A simple solution is to give it smaller bites. A couple of ways to accomplish that is only loading JAR files that are needed, using indexed metadata to lookup annotations, class structure (reflection information) and XML data rather than full scans and, finally, shutting down idle services. These optimizations enable JBoss Application Server 7 to run with stock JVM settings on even the smallest devices.

An interesting example from the memory diet is the moratorium on using JAXB (or any other introspection driven binder) to parse configuration that’s only read once. These frameworks often spend more time figuring out how to parse than to do the actual parsing and binding, which itself is time consuming. These calculations add up. Just the XML processing in JBoss Application Server 5 and JBoss Application Server 6 takes longer than the entire JBoss Application Server 7 boot time!

If you want to make the server even more lean beyond what the Java EE 6 Web Profile affords, you can define a custom server profile to prune unneeded capabilities. Profiles are easy to create, since they are defined as an alternative configuration file, as opposed to having to physically remove files and directory. Regardless, we’re confident most developers will be happy with the leanness of the default Web Profile stack.

Being fast and lightweight enhances developer productivity tremendously, until all those gains are thrown out the window trying to remedy a leaky classloader that’s exposing the wrong version of an XML parser. It’s jar hell! Proper modularity keeps the developer out of the weeds, and JBoss Application Server 7 delivers once again.


Dan Allen
Dan Allen

What do you think?

JAX Magazine - 2014 - 06 Exclucively for iPad users JAX Magazine on Android


Latest opinions