Red Hat

In Relation To Jason Greene

In Relation To Jason Greene

Why is JBoss AS 7 so fast?

Posted by    |       |    Tagged as JBoss AS

The short answer is that it is designed around Ahmdahl's law (effective parallelization of work) as opposed to Moore's law (waiting for hardware with a faster clock rate). Almost every CPU powering desktops, laptops, and servers is now at least dual core, and the trend is rapidly expanding. The days of the frequency race are essentially over. So, now software must adapt to tap into the power of the hardware of today and tomorrow.

JBoss AS underwent an aggressive transformation to achieve this critical evolution. With AS 7 we started from scratch and built an entirely new, highly performant, and manageable core architecture from the ground up. With some truly amazing engineering effort we were able to go from a tiny prototype on github, to the full blown Java EE Web Profile compliant container of today in a little over a year (not to mention that during all of this we also delivered AS 6 which allowed JBoss users early access EE6 technology).

Before explaining, allow me to provide some background. The core problem an application server is tasked with is managing services. Nearly all components in a modern application have some kind of life-cycle, meaning that there is some point at which it must be started, and some later point at which it must be stopped. We label anything that has a life-cycle a service. Another important property of a service is that they typically have relationships that impact their respective life-cycles. As an example, we might say that a servlet's service depends on a web server. In addition we would probably say that if that servlet uses some other resource like a database connection or an EJB that it depends on those being being available as well. When an application server starts or deploys it must make sure that it starts all of the various services in the correct order. Further if any of these services are somehow stopped, it must stop all dependents first (essentially reverse order). This is a fairly simple problem when this is done in a single thread.

JBoss AS 7 on the other hand starts and deploys all services in parallel. This complex problem is solved by our new service container, the JBoss Modular Service Container. MSC is essentially an advanced concurrent state machine. It analyzes the dependencies between all services on the fly and attempts to start as many as it can at the same time, while still adhering to the relationship requirements. This means that not only is startup blazing fast, but you also now can deploy multiple deployments in parallel.

In addition to parallel services, JBoss AS 7 also has modularity and concurrent class loading. By segmenting classes into proper modules, the app server can naturally optimize access patterns, and only look in the spot that truly owns the classes. Also, since the visibility between modules is intentionally limited, searching is cheap. In the case of JBoss Modules, module resolution and class lookup are O(1). All of this has a very high degree of concurrency, even a significant portion of class definition.

Deployment processing is also very efficient. One major optimization is that we index annotation information by quickly scanning a subset of the class file data. For even greater efficiency we allow modules the ability to pregenerate a space efficient index which is designed to be loaded very quickly. Yet another deployment optimization is that we carefully cache and reuse reflection data, since the JVM is not very efficient at doing so.

Finally the last major reason I wanted to highlight is that we have and will continue to be very militant about our CPU and memory usage on the start and deploy path. This is all about making good choices starting at the design phase. An interesting example is our moratorium on using JAXB (or any other introspection driven binder) to parse configuration that is only read once. It ends up spending the same or more time figuring out how to parse than it does doing the actual parsing. This adds up. In fact, just the XML processing in AS 5 and 6 took longer than the entire 7 boot time.

Hopefully this provides a better picture as to how we made the efficiency gains, and why some things are very different in 7 than in the past. This, however, is just the beginning. Stay tuned for my next blog which will talk about the overall 7 roadmap.


The 7 ^ 2 Heros of AS7

Posted by    |       |    Tagged as JBoss AS

You may have heard that AS7 Final has been released! . I plan to say a lot about this, but before I do, I wanted to call attention to the many heroes whose contributions made this monumental release possible.

  • Dan Allen
  • Max Rydahl Andersen
  • Dimitris Andreadis
  • John E. Bailey
  • Marius Bogoevici
  • David Bosschaert
  • Heiko Braun
  • Tomaz Cerar
  • Jean-Frederic Clere
  • Thomas Diesler
  • Andrew Dinn
  • Vladimir Dosoudil
  • Stuart Douglas
  • Steve Ebersole
  • Paul Ferraro
  • Howard Gao
  • Paul Gier
  • Stefan Guilhen
  • Ales Justin
  • Kabir Khan
  • Aslak Knutsen
  • David M. Lloyd
  • Darran Lofthouse
  • Alexey Loubyansky
  • Jim Ma
  • Stefano Maestri
  • Scott Marlow
  • Rémy Maucherat
  • Shelly McGowan
  • Bob McWhirter
  • Marcus Moyses
  • Emanuel Muckenhuber
  • Pete Muir
  • Richard Opalka
  • Jaikiran Pai
  • Jonathan Pearlin
  • Jesper Pedersen
  • James Perkins
  • Flavia Rainone
  • Andrew Lee Rubinger
  • Anil Saldhana
  • Stan Silvert
  • Alessio Soldano
  • Brian Stansberry
  • Scott M Stark
  • Andy Taylor
  • Carlo de Wolf
  • Jeff Zhang

and lastly:

  • The JBoss Community, and all our excellent first class components whose authors are too many to mention.

AS7 Beta Stream Begins!

Posted by    |       |    Tagged as JBoss AS

I am happy to announce that last week we officially kicked off the beta stream for AS7. This will be a very rapid biweekly release schedule up until we hit CR. So expect to see a lot coming from us very quickly.

The first release of this series is AS 7 Beta1, Ides of March (released on the 15th), and it includes a number of significant changes/improvements over the original alpha.

On the management front, we have moved to fully detyped management model which will allow for Java based management clients to use a single, small library, for controlling any subsystem in AS7. We also now have a new HTTP/JSON interface that allows for applications/tools to be easily written in any language, since most have a number of JSON frameworks already. Finally, we have an initial implementation of our CLI (command line interface). The CLI included in this release focuses on exposing the lower level operation API that is part of our other management interfaces. Future releases will include a more task/command driven layer, which we expect to be the most commonly used.

On the EE front, we have completed the core foundation of our unified component infrastructure. All EE components (Servlets, EJBs, Managed Beans, etc) have common annotation processing, naming, injection, lifecycle, proxy, and interceptor facilities. All of it is dependency based and takes advantage of our lightweight service container. This means that deployments will automatically start in the correct order even with complex relationships. Also if one fails it can succeed later if the facility it depended on becomes available.

In addition we have initial support for a number of the EE web profile (and beyond) technologies including:

  • EJB - Annotation driven SLSBs, SFSBs, and Singletons
  • JPA
  • CDI/Weld
  • JSF
  • Bean Validation
  • JAX-RS / Resteasy
  • JAX-WS

You'll also notice that even with all of these additional services running we still have a very fast boot-up time (1800ms on my system).

You can download the Beta1 release in the usual location

The current getting started wiki is here.

Stay tuned for Beta2...

AS 7.0.0.Alpha1 released!

Posted by    |       |    Tagged as JBoss AS

As AS6 has been getting closer to CR, we have recently started working on our new next generation application server. Last week, we just released an early alpha of this work, 7.0.0.Alpha1, code named Halloween.

I am putting links first, in case you don't feel like reading my long post:

You can download the release in the usual place here:

There is some basic user instructions here:

Also, Brian, one of our core devs hacked together a quick late-night (yet very nice) demo covering the new powerful management capabilities:

As you can see, the biggest change in AS7 is that we are treating administrators with the same love that we have always shown developers. In particular, we have been doing a lot of thinking about how to make their lives easier when it comes to managing small to very large environments. This is a very important part of a bigger effort you may have heard us reference called "Andiamo", a major focus on improving the usability of JBoss projects and products.

In AS7, configuration is now centralized and presented in a user-friendly manner. So instead of searching for one of our beans.xml files to change some settings for a specific subsystem, you now know exactly where to look. Also the configuration can now describe an entire domain. This means any number of servers, and groupings thereof can be controlled in one place.

For those that don't want to run in a more complex domain topology, we have a simpler more traditional mode you can run JBoss AS in called standalone. The configuration is largely the same, but is slightly simplified, so you still benefit from user-friendly configuration all in one place.

AS7 isn't just about administrators, we are also aiming to make life better for developers as well. One big change we are making is moving to a "pure" modular class-loading environment that will allow us to finally hide our implementation classes from application deployments. In other words, if we decide to use foobar.jar, version 1.1, your application won't see those classes, so it can happily use foobar 2.2.

Another big change on the developer front is that the AS7 service container is fully concurrent, which takes advantage of modern cpus. This among other changes leads to a much improved boot time.

Note that this release just offers a glimpse into the management model and server environment we are working on. EE capabilities will be added as they are developed in subsequent releases.

If you are interested in contributing, check out our Hacking on AS7 page.


Git is awesome

Posted by    |       |    Tagged as

Very rarely do I find a tool that doesn't have some issue I have to workaround (even minor). Even more rarely do I find a tool that continues to impress me beyond what I thought I needed.

Git is such a tool.

AS 6.0.0.M3 released!

Posted by    |       |    Tagged as JBoss AS

Last week we released the third milestone for AS6. One major improvement this release brings is a completely new high performance messaging implementation. HornetQ is available out of the box, all you have to do is setup your queues/topics and deploy any EE app using JMS. You can read more about this on Clebert's blog .

Another major feature this release includes is support for EJB 3.1 singleton beans, and container managed concurrency. For those that aren't familiar with singleton beans, they are essentially a stateless bean that can be used similar to the "servlet" model, where you can have multiple concurrent requests on the same instance. Traditional stateless session beans can never allow multiple threads to execute on the same instance. This means the container must pool a collection of instances to be ready to process your request load. The obvious advantage this brings is that it simplifies the bean implementation; however, for some applications the pooling, especially when left untuned, can be counter-productive. Singletons are a way to achieve greater control by allowing the application to implement any concurrency/locking model of its choosing.

If you have an application that that follows a common read/write locking pattern, then a singleton can optionally use container managed concurrency by annotating methods with the @Lock(READ) and @Lock(Write) annotations. This gives you the additional control but takes some of the burden of lock management away.

Another notable addition to the M3 release, is a new OSGI profile that can be triggered using the -c option:

./ -c osgi

This will start a number of OSGi services, as well as the ability to directly deploy bundles. You can find out more on how to use this new profile by checking out the JBoss OSGI project docs.

There are of course many other improvements too numerous to mention. To get the complete list of features, changes, and fixes that made this release, take a look at the full release notes, available here.

As always, you can download all AS releases on the AS download page.

AS 6.0.0.M2 is here!

Posted by    |       |    Tagged as JBoss AS

JBoss AS 6.0.0.M2 has just been released. A major highlight is that this release delivers three more key EE6 capabilities:

  • JPA 2
  • Servlet 3
  • JAX-RS (RESTful services).

You can read all about it in Brian's official announcement here.

Get it now!

Introducing JBoss AS 6.0.0.M1

Posted by    |       |    Tagged as Java EE JBoss AS Seam

How do you follow the fantastic news of the week with the Java EE6 platform and CDI getting final approval ? How about a JBoss AS release that includes support for three key EE6 features: CDI, Bean Validation, and JSF 2?


For those that aren't familiar with these technologies, each offers significant improvements to EE application development.

CDI (or Contexts and Dependency Injection) brings real context management and DI to the EE platform, and simplifies the integration of EE services with your application. Not only does it have innovative features that make life easier, but everything it does is completely type-safe, and easily extensible. Check out Gavin's interview with DZone for more information. Also check out the Weld page (our implementation and also the RI for CDI).

Bean Validation solves one of the biggest problems developers face daily, ensuring their data model is validated consistently and correctly as it progresses through each layer of an application. Instead of the common current cut-and-paste practice that is difficult to maintain and error prone, Bean Validation allows you to put all of your validation rules where they belong, the data model itself. Since JSF 2 and JPA 2 integrate with Bean Validation, all layers of your application will enforce those rules. This reduces errors, simplifies development, and saves time (and your C and V keys). For more information see Emmanuel's blog on Hibernate Validator 4 (our implementation of Bean Validation). Stay tuned for more info on how to integrate Bean Validation in your EE applications.

For those of you running in high availability environments, we have also included a brand new intelligent load balancing module called mod_cluster. You can read all about that in Brian's blog.

Note that in this release we are switching to a milestone based versioning scheme. The primary reason for this change is to provide a way to get completed features to the community as soon as they are ready. This is quite a bit different from a normal Alpha/Beta scheme which typically results in many incomplete capabilities in raw fashion, that slowly become complete towards the end of the release lifespan. The milestone model instead focuses on time constrained releases that each provide a small set of completed features. As an example, the M1 release actually includes Weld 1.0.0, which is a stable final release of Weld. If you are thinking of targeting your application on AS 6.0.0, you will be able to start with M1, and progress to future milestones as we add features and improvements.

You can find the full release notes for the release here, and the official download location is here.

As always, have a great open source day!

JBoss AS 5.1.0.CR1 is out (and with a new console)

Posted by    |       |    Tagged as JBoss AS

I am happy to announce the 5.1.0.CR1 release of the JBoss Application Server! This is the first AS release to include Embedded JOPR, our new web-based administration console. We are hoping to get as much feedback as possible before releasing the final 5.1.0, so please try it out and tell us what you think.

Also included in this release is the new 1.0.0.PREVIEW release of Web Beans, a key technology that greatly simplifies EE web development. This release is the first feature complete implementation of the public draft. Check out Pete's blog for more info.

For those that were missing the farming clustering service, it is now back as of this release. See the wiki page on the relevant changes.

As always, many other updates too numerous to mention were made. To see the full list, check out the detailed release notes.

Download 5.1.0.CR1 here, and have a great open source day!

Javassist now provides data-flow analysis API

Posted by    |       |    Tagged as Java EE

Out of need, I recently contributed a data-flow analysis framework to javassist. The framework allows an application to determine, by inference, the type-state of the local variable table and stack frame at the start of every bytecode instruction. For those unfamiliar with the java bytecode format, a lot of information is lost once a java program is compiled, since it is not really needed when the program is executed, and leaving it out helps keep class files small.

To illustrate this loss, take a look at the following simple Java method:

public static class Base {}
public static class A extends Base{}
public static class B extends Base{}
public static class C extends B{}

private void foo(int x) {
   Base b;
   if (x > 4) {
       b = new A();
   } else {
       b = new C();


While it is quite clear in the Java code that b is of type Base, this information is missing from the output of a compiler:

private void foo(int);
   Stack=2, Locals=3, Args_size=2
   0:   iload_1
   1:   iconst_4
   2:   if_icmple       16
   5:   new     #68; //class example/Example$A
   8:   dup
   9:   invokespecial   #70; //Method example/Example$A."<init>":()V
   12:  astore_2
   13:  goto    24
   16:  new     #71; //class example/Example$C
   19:  dup
   20:  invokespecial   #73; //Method example/Example$C."<init>":()V
   23:  astore_2
   24:  aload_2
   25:  invokevirtual   #74; //Method java/lang/Object.toString:()Ljava/lang/String;
   28:  pop
   29:  return

Since toString() is declared by Object, all that line 25 tells us is that the type is an Object, which is obviously not very specific. If the class was compiled with debugging, you would be able to learn that local #2 was of type Base, but even if you did have this information, you would not necessarily know that the object invoked on by invokevirtual is the value stored in local variable 2. The only way to determine that is to know the state of the stack frame immediately before the instruction executes.

The analysis framework provides this by modeling the effect of every instruction, until it can eventually infer the type information. This process does not use any debugging information, since there is no guarantee it is available. Instead, it extrapolates it by tracking all possible type states, as every branch is evaluated, until the type information is reduced to the most specific type state available.

The following code, which uses the framework, is able to tell us that the type invoked on line 25 is in fact Base:

Analyzer a = new Analyzer();
CtClass clazz = ClassPool.getDefault().get("example.Example");
Frame[] frames = a.analyze(clazz.getDeclaredMethod("foo"));
System.out.println(frames[25].peek()); // Prints "example.Example$Base"

There is also a nice little tool I added, called framedump, that dumps the entire state at every instruction in human readable format, and yes I know that's debatable :)

$ framedump example.Example
private void foo(int);
0: iload_1
     stack []
     locals [example.Example, int, empty]

... snipped for brevity ...

24: aload_2
     stack []
     locals [example.Example, int, example.Example$Base]
25: invokevirtual #85 = Method java.lang.Object.toString(()Ljava/lang/String;)
     stack [example.Example$Base]
     locals [example.Example, int, example.Example$Base]
28: pop
     stack [java.lang.String]
     locals [example.Example, int, example.Example$Base]
29: return
     stack []
     locals [example.Example, int, example.Example$Base]

Some of you are probably thinking:

That sounds nice and all, but why in the world would I ever need to use this?

It is definitely not something useful to everyone, however it is very useful for certain applications:

  • Bytecode Enhancers
  • Verifiers
  • Optimizers
  • Debugging/Profiling Tools
  • Decompilers

To expand on the enhancer example, for security reasons, the JVM actually does its own data-flow analysis to verify that a class does not violate type rules before it can be ran. This poses an interesting challenge to any application that manipulates bytecode, since any change that affects the possible type-state can lead to a verify error and the JVM throwing out the class. Frameworks such as this can be used to prevent this problem, since they reveal the same (in the javassist analyzer case, actually more detailed) information available to the JVM's verifier.

If you want to play with this new feature, download the recently released 3.8.0 here.

The javadoc is here.

Note, I should also mention that the ASM project has had a similar framework for quite some time, however, it wasn't usable in my case since I needed the ability to handle reduction of multi-interface and array types. Also, I was already using javassist and switching just wasn't possible, mainly due to other features I rely on.


back to top