Changeset 0439206 for apps/jrobin


Ignore:
Timestamp:
Oct 26, 2016 7:31:40 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
886dbf1
Parents:
78acf70
Message:

JRobin: Fix for Java 9 to remove dependency on Sun private classes
https://github.com/OpenNMS/jrobin/issues/3
http://stackoverflow.com/questions/1854398/how-to-garbage-collect-a-direct-buffer-java
Code from http://sourceforge.net/p/tuer/code/HEAD/tree/pre_beta/src/main/java/engine/misc/DeallocationHelper.java
unmodified, GPLv2

Location:
apps/jrobin/java/src
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • apps/jrobin/java/src/org/jrobin/core/RrdNioBackend.java

    r78acf70 r0439206  
    2525
    2626
    27 import sun.nio.ch.DirectBuffer;
     27import engine.misc.DeallocationHelper;
    2828
    2929/**
     
    3636    private final SyncManager m_syncManager;
    3737    private MappedByteBuffer m_byteBuffer = null;
     38    private static final DeallocationHelper _dHelper = new DeallocationHelper();
    3839
    3940    /**
     
    106107        }
    107108        if (m_byteBuffer != null) {
    108             if (m_byteBuffer instanceof DirectBuffer) {
    109                 ((DirectBuffer) m_byteBuffer).cleaner().clean();
    110             }
     109            _dHelper.deallocate(m_byteBuffer);
    111110            m_byteBuffer = null;
    112111        }
Note: See TracChangeset for help on using the changeset viewer.