-
Bug
-
Resolution: Done
-
Major
-
20.0.1.Final
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
- is blocked by
-
WFLY-13912 Upgrade RESTEasy to 3.13.2.Final
- Closed
- is cloned by
-
JBEAP-20400 (7.3.z) Memory leak caused by org.eclipse.yasson.internal.JsonBinding
- Closed
- is incorporated by
-
WFLY-13922 Upgrade RESTEasy to 3.13.2.Final
- Closed