[ 
https://issues.apache.org/jira/browse/IGNITE-18604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17696137#comment-17696137
 ] 

Mikhail Pochatkin commented on IGNITE-18604:
--------------------------------------------

As you can see some micro leaks are exist but this is can't be fixed at least 
now. This is lambdas, NettyHttpServer, ApplicationContext and etc. objects 
which are captured by shutdown hook

> 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
>
>          Time Spent: 10m
>  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