You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Tupitsyn (Jira)" <ji...@apache.org> on 2019/08/19 20:35:00 UTC

[jira] [Commented] (IGNITE-9638) .NET: JVM keeps track of CLR Threads, even when they are finished

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

Pavel Tupitsyn commented on IGNITE-9638:
----------------------------------------

Investigated the last point further. We can detect a thread exit on .NET side by putting an object with a finalizer into ThreadLocal, but this happens on a finalizer thread, not the original thread. So we can't call DetachCurrentThread, and JNI does not allow detaching non-current thread. So this looks like a dead end.

> .NET: JVM keeps track of CLR Threads, even when they are finished 
> ------------------------------------------------------------------
>
>                 Key: IGNITE-9638
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9638
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms
>    Affects Versions: 2.6
>            Reporter: Ilya Kasnacheev
>            Assignee: Pavel Tupitsyn
>            Priority: Major
>              Labels: .NET
>             Fix For: 2.8
>
>         Attachments: IgniteRepro.zip
>
>
> When you create a Thread in C#, JVM creates corresponding thread "Thread-NNNN" which is visible in jstack. When C# joins this thread, it is not removed from JVM and is kept around. This means that jstack may show thousands of threads which are not there. Reproducer is attached. It is presumed that memory will be exhausted eventually.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)