[ 
https://issues.apache.org/jira/browse/IGNITE-18604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mikhail Pochatkin updated IGNITE-18604:
---------------------------------------
    Attachment: screenshot-3.png

> Memory Leak in Micronaut
> ------------------------
>
>                 Key: IGNITE-18604
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18604
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Ivan Bessonov
>            Assignee: Mikhail Pochatkin
>            Priority: Major
>              Labels: ignite-3
>         Attachments: screenshot-1.png, screenshot-2.png, screenshot-3.png, 
> screenshot-4.png, screenshot-5.png, screenshot-6.png
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Micronaut class code contains the following code:
> {code:java}
> Runtime.getRuntime().addShutdownHook(new Thread(() -> {
>     if (LOG.isInfoEnabled()) {
>         LOG.info("Embedded Application shutting down");
>     }
>     if (embeddedApplication.isRunning()) {
>         embeddedApplication.stop();
>         countDownLatch.countDown();
>         if (finalKeepAlive) {
>             mainThread.interrupt();
>         }
>     }
> })); {code}
> This hook is never removed, thus there's a GC root for the 
> "embeddedApplication" instance. It leaks beans and other stuff, for example:
>  * io.micronaut.runtime.Micronaut#exitHandlers
>  * io.micronaut.context.DefaultApplicationContextBuilder#singletons
>  * ...
> This is bad, because inside of all of this we have classes like 
> ClusterManagementRestFactory and 
> ClusterManagementController that refer to Ignite components and have 
> particularly big footprints.
>  
> As a result, if you run 
> org.apache.ignite.internal.rest.ItGeneratedRestClientTest in a loop, it eats 
> all the memory.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to