My Oracle Support Banner

Memory Leak In Jersey REST API. (Doc ID 2023551.1)

Last updated on JUNE 07, 2023

Applies to:

Oracle WebLogic Server - Version 12.1.3.0.0 and later
Information in this document applies to any platform.

Symptoms

Facing a problem of heap saturation when using a service based on the 2.5.1 version Jersey REST API. 

To reproduce the issue:

  1. Use two Weblogic servers, each with a service based on REST (REST servlet on input and RESTclient for output)
  2. Inject a load on the service.  The test reproduced using 13 transactions per second.
  3. The saturation appears after 20 minutes with 1Gb of heap memory.
  4. The increase of the response time starts with the REST output (from 100ms up to 120s) and contaminates the REST input (from 40 ms up to 12s).


What can be seen after first analysis is a huge creation of instances in Jersey, a lot of class loading and class initialisation.

In particular, instances of org.glassfish.jersey.client.ClientRuntime are created at the rate of the REST output transactions.  It behaves as if the Jersey client instance (org.glassfish.jersey.client.JerseyClient, a singleton for this service) recreates the entire call stack for each connection.


Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.