Package io.scanbot.core
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.
-
-
Constructor Summary
Constructors Constructor Description SelfDisposable(Long disposeTimeoutMs)
-
Method Summary
Modifier and Type Method Description -
-
Constructor Detail
-
SelfDisposable
SelfDisposable(Long disposeTimeoutMs)
- Parameters:
disposeTimeoutMs
- milliseconds to wait when unused before disposing native instance.
-
-
-
-