question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ObjectCleanerThread not be closed

See original GitHub issue

Netty version

4.1.20.Final

JVM version (e.g. java -version)

9.0.1

OS version (e.g. uname -a)

Windows 10

Non-finished threads:

Thread[DestroyJavaVM,5,main]

Thread[ObjectCleanerThread,1,main] at java.base@9.0.1/java.lang.Object.wait(Native Method) at java.base@9.0.1/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151) at app//io.netty.util.internal.ObjectCleaner$1.run(ObjectCleaner.java:52) at app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base@9.0.1/java.lang.Thread.run(Thread.java:844)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
johnoucommented, Jan 25, 2018

@normanmaurer I would expect something like this to exit gracefully without an explicit System.exit call.

public class Main {

    public static void main(String[] args) {
        ByteBuf byteBuf = PooledByteBufAllocator.DEFAULT.buffer();
        byteBuf.release();
        System.gc();
        System.runFinalization();
        // hangs because ObjectCleanerThread is not a daemon thread / LIVE_SET is not empty..
    }
}
1reaction
normanmaurercommented, Jan 25, 2018

@johnou @hank-whu after reading more up on all of this I think you are right and @Scottmitch and myself were wrong … This must be a deamon thread to ensure we will be able to shutdown in all cases. OpenJDK itself also uses a deamon thread and the GC threads are also deamon threads: https://github.com/dmlloyd/openjdk/blob/342a565a2da8abd69c4ab85e285bb5f03b48b2c9/src/java.base/share/classes/jdk/internal/ref/CleanerImpl.java#L117

Let me come up with a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

Objects are not getting cleared in Old Gen even after GC
Objects are not getting cleared in Old Gen even after GC - Netty ObjectCleanerThread retaining objects in JBoss EAP 7.2.
Read more >
ObjectCleanerThread must be a deamon thread to ensure the ...
Motivation: The ObjectCleanerThread must be a daemon thread as otherwise we may block the JVM from exit. By using a daemon thread we ......
Read more >
[MC-146579] Server CPU usage at 100% for all cores - Jira
CPU usage jumps to 100% on all cores for about 5-10 seconds (maybe more) and repeats often, causing server lag, such as moving...
Read more >
CLion is taking up 400-600% CPU and not responsive
CLion takes up all CPU right from launch and frizzes after some time. I increased memory and disabled all smart code editing features...
Read more >
Redisson not shutting down keeps Java VM open
"ObjectCleanerThread" #13 prio=1 os_prio=31 tid=0x00007f885a05e800 nid=0xa803 in Object.wait() [0x00007000092cf000] java.lang.Thread.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found