Java EE and the resources

With Java EE, you will likely have a lot of volatile objects (with a short lifespan) that are bound to a request. If we take QuoteResource, we will first allocate our JSON model, then our entity model, and so on. All these instances will be needed for the request only and nothing more. Thus, the garbage collector will quickly collect them. The garbage collector is quite good for such dynamic applications. However, it doesn't mean that we do not have long living instances. Even without an application cache, the server caches a lot of metadata to ensure that it works and runs fast. One example is the CDI container, which will keep the metadata of all the beans in the memory to make sure that it can create them when ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.