Best Practices
Memory Management
Adobe PDF Library Java/Maven
Adobe PDF Library (APDFL) objects can be associated with a large amount of unmanaged memory, which exerts little pressure on the runtime. As a result, there may be a long period before the garbage collector deletes these objects because it is not aware of the size of the unmanaged or native objects in APDFL.
Once garbage collection happens, a large amount of memory associated with objects no longer in use is freed.
Release unmanaged resources in APDFL as soon as an object is no longer in use, rather than waiting for garbage collection.
To do this, call the delete() method of the object's class.