Class SelfDisposable

  • All Implemented Interfaces:

    public abstract class SelfDisposable

    Wrapper for a native object to make it auto-finalize after some time of the object being unused.

    The need for this wrapper is came from the fact that the Native memory usage is not visible for GC, so for some classes like DC it stays in memory for some time even after the object is not actually used. And as DC scanner takes more than 1GB ram it may lead to OOM. This wrapper solves this problem by disposing the native part of the object after DISPOSE_TIMEOUT_MS seconds of not being used.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Modifier and Type Field Description
    • Constructor Summary

      Constructor Description
      SelfDisposable(Long disposeTimeoutMs)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SelfDisposable

        SelfDisposable(Long disposeTimeoutMs)
        disposeTimeoutMs - milliseconds to wait when unused before disposing native instance.
    • Method Detail