-
Bug
-
Resolution: Done
-
Major
-
None
-
None
org.eclipse.yasson.internal.JsonBinding keeps a reference on an enum after the war is undeployed which results in a classloader leak.
1- Deploy the following application:
package au.com.spatiumxl.model; public class Book { public enum Status { READ, UNREAD } private String title; private Book.Status status; public Book(String title) { this.title = title; this.status = Book.Status.UNREAD; } public String getTitle() { return title; } public Book.Status getStatus() { return status; } }
package au.com.spatiumxl.ejb; [...] import au.com.spatiumxl.model.Book; @Stateless @LocalBean public class BookService { public List<Book> getBooks() { List<Book> books = new ArrayList<>(); books.add(new Book("title1")); return books; } }
package au.com.spatiumxl.rest; [...] import au.com.spatiumxl.ejb.BookService; import au.com.spatiumxl.model.Book; @RequestScoped @Path("")public class BookEndPoint { @Inject BookService bookService; @GET @Path("/get-books") @Produces("application/json") public List<Book> getBooks() { return bookService.getBooks(); } }
2- On the browser go to: http://<host>/<context-root>/.../get-books
3- Undeploy the war
4- The memory analyser shows:
java.lang.Thread org.jboss.modules.ModuleClassLoader org.jboss.modules.Module org.jboss.modules.LocalModuleLoader java.util.concurrent.ConcurrentHashMap java.util.concurrent.ConcurrentHashMap$Node[] java.util.concurrent.ConcurrentHashMap$Node org.jboss.modules.ModuleLoader$FutureModule org.jboss.modules.Module org.jboss.modules.ModuleClassLoader java.util.Vector java.lang.Object[] org.jboss.resteasy.plugins.providers.jsonb.AbstractJsonBindingProvider org.eclipse.yasson.internal.JsonBinding org.eclipse.yasson.internal.JsonbContext org.eclipse.yasson.internal.MappingContext java.util.concurrent.ConcurrentHashMap java.util.concurrent.ConcurrentHashMap$Node[] java.util.concurrent.ConcurrentHashMap$Node org.eclipse.yasson.internal.model.ClassModel org.eclipse.yasson.internal.model.PropertyModel[] org.eclipse.yasson.internal.model.PropertyModel au.com.spatiumxl.model.Book$Status
- clones
-
WFLY-13790 Memory leak caused by org.eclipse.yasson.internal.JsonBinding
- Closed
- is incorporated by
-
JBEAP-20399 (7.3.z) Upgrade RESTEasy from 3.11.2.Final.redhat-00001 to 3.11.3.Final.redhat-00001
- Closed