为什么堆被sun.misc.cleaner对象污染了

pdkcd3nj  于 2021-06-27  发布在  Java
关注(0)|答案(0)|浏览(214)

当我从一个java进程(jgroup gossiprouter)中进行连续堆转储时,sun.misc.cleaner、java.nio.directbytebuffer$deallocator和sun.nio.ch.iovecwrapper$deallocator的对象数正在增加。
我们在代码中没有使用这些对象,这些对象正被javanio代码引用。我找不到为什么这些对象被保存在内存中,以及哪个线程引用它们。这里的线程数没有增加。请帮帮我!
创建这些对象的堆栈,

at sun.misc.Cleaner.<init>(Cleaner.java:49)
at sun.misc.Cleaner.create(Cleaner.java:57)
at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:139)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311)
at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:241)
at sun.nio.ch.IOUtil.read(IOUtil.java:195)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.jgroups.nio.Buffers.readLengthAndData(Buffers.java:135)
at org.jgroups.blocks.cs.NioConnection._receive(NioConnection.java:236)
at org.jgroups.blocks.cs.NioConnection$Reader._run(NioConnection.java:454)
at org.jgroups.blocks.cs.NioConnection$Reader.run(NioConnection.java:443)
at java.lang.Thread.run(Thread.java:748)

清理这些对象的堆栈,1。

at sun.misc.Cleaner.clean(Cleaner.java:61)
at sun.nio.ch.Util.free(Util.java:299)
at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:239)
at sun.nio.ch.IOUtil.read(IOUtil.java:195)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.jgroups.nio.Buffers.readLengthAndData(Buffers.java:135)
at org.jgroups.blocks.cs.NioConnection._receive(NioConnection.java:236)
at org.jgroups.blocks.cs.NioConnection$Reader._run(NioConnection.java:454)
at org.jgroups.blocks.cs.NioConnection$Reader.run(NioConnection.java:443)
at java.lang.Thread.run(Thread.java:748)
at sun.misc.Cleaner.clean(Cleaner.java:61)
at java.lang.ref.Reference.tryHandlePending(Reference.java:212)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题