[
https://issues.redhat.com/browse/WFLY-13790?page=com.atlassian.jira.plugi...
]
Ahcene Kessal edited comment on WFLY-13790 at 9/22/20 7:00 AM:
---------------------------------------------------------------
*Attachments*:
||Attached artifacts||Description||
|app.zip|app used to trigger the memory leak|
|WFLY-13790-0.0.1-SNAPSHOT.war|built package from "app.zip"|
|wildfly-20.0.1.Final.PNG|memory graph from wildfly-20.0.1.Final|
|wildfly-20.0.1.Final+patch.PNG|memory graph from "wildfly-20.0.1.Final +
patch"|
*Test description:*
Start application server "wildfly-20.0.1.Final" and "jconsole.exe" to
record memory usage.
# deploy WFLY-13790-0.0.1-SNAPSHOT.war
# on browser get: [
http://localhost:8080/rest/get-books]
# un-deploy WFLY-13790-0.0.1-SNAPSHOT.war
# re-deploy WFLY-13790-0.0.1-SNAPSHOT.war
# on browser get: [
http://localhost:8080/rest/get-books]
repeat the above steps again and again
*note*: for deploying/un-deploying operations I used "jboss-cli.bat":
{code:java}
[standalone@localhost:9990 /] /deployment=WFLY-13790-0.0.1-SNAPSHOT.war:undeploy()
[standalone@localhost:9990 /] /deployment=WFLY-13790-0.0.1-SNAPSHOT.war:deploy {code}
*Test results:*
# with wildfly-20.0.1.Final, the JVM throws _*OutOfMemoryError*_ after 6 iterations
# I swapped "resteasy-json-binding-provider-3.12.1.Final.jar" for the one built
from
[
https://github.com/rsearls/Resteasy/commit/55a0c2f6b3dc9b396513ec615cd49b...
I repeated the test. The memory leak does not occur anymore, I repeated the test 15 times
and then I stopped.
The memory graphs are attached.
The patch resolves the issue and this case can be closed.
was (Author: ahcenek):
*Attachments*:
||Attached artifacts||Description||
|app.zip|app used to trigger the memory leak|
|WFLY-13790-0.0.1-SNAPSHOT.war|built package from "app.zip"|
|wildfly-20.0.1.Final.PNG|memory graph from wildfly-20.0.1.Final|
|wildfly-20.0.1.Final+patch.PNG|memory graph from "wildfly-20.0.1.Final +
patch"|
*Test description:*
Start application server "wildfly-20.0.1.Final" and "jconsole.exe" to
record memory usage.
# deploy WFLY-13790-0.0.1-SNAPSHOT.war
# on browser get: [
http://localhost:8080/rest/get-books]
# un-deploy WFLY-13790-0.0.1-SNAPSHOT.war
# re-deploy WFLY-13790-0.0.1-SNAPSHOT.war
# on browser get: [
http://localhost:8080/rest/get-books]
repeat the above steps again and again
*note*: for deploying/un-deploying operations I used "jboss-cli.bat":
{code:java}
[standalone@localhost:9990 /] /deployment=WFLY-13790-0.0.1-SNAPSHOT.war:undeploy()
[standalone@localhost:9990 /] /deployment=WFLY-13790-0.0.1-SNAPSHOT.war:deploy {code}
*Test results:*
# with wildfly-20.0.1.Final, the JVM throws _*OutOfMemoryError*_ after 6 iterations
# I swapped "resteasy-json-binding-provider-3.12.1.Final.jar" for the one built
from
[
https://github.com/rsearls/Resteasy/commit/55a0c2f6b3dc9b396513ec615cd49b...
I repeated the test. The memory leak does not occur anymore, I repeated the test 15 times
and then I stopped.
The memory graphs are attached.
The patch resolves the issue and this case can be closed.
Memory leak caused by org.eclipse.yasson.internal.JsonBinding
-------------------------------------------------------------
Key: WFLY-13790
URL:
https://issues.redhat.com/browse/WFLY-13790
Project: WildFly
Issue Type: Bug
Components: REST
Affects Versions: 20.0.1.Final
Reporter: Ahcene Kessal
Assignee: r searls
Priority: Major
Attachments: WFLY-13790-0.0.1-SNAPSHOT.war, app.zip,
wildfly-20.0.1.Final+patch.PNG, wildfly-20.0.1.Final.PNG
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:
{code:java}
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;
}
}
{code}
{code:java}
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;
}
}
{code}
{code:java}
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();
}
}
{code}
2- On the browser go to: http://<host>/<context-root>/.../get-books
3- Undeploy the war
4- The memory analyser shows:
{code:java}
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
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)