RFR 9: 8165641 : Deprecate Object.finalize

Uwe Schindler uschindler at apache.org
Sun Mar 12 19:02:37 UTC 2017


Hi,

> >> I guess "difficulty in properly triggering GC for non-memory resource
> >> exhaustion" is closest to what I just described.
> >
> > This has long been an issue in the Java client area where native desktop
> > resources or the like need to be managed carefully, but it is not just
> > native window handles but any resource not managed by GC.
> >
> > So more precisely "non-Java Heap" resource exhaustion as you could
> > allocate 2GB of native heap and the GC would not care at all if
> > it were tied solely to a 32 byte finalizable Java object.
> 
> Indeed.  For what it's worth, I have a plan to design and implement a
> mechanism to allow native memory to be safely deallocated without
> using finalization, but it's proving rather difficult to find a nice
> way to design the API and make it fit the JMM.  I hope to get it done
> by JDK 10.  :-)

Yeah, make it work! If you have some time, don't mind to share updated ideas with Robert Muir and me!

Thanks, Uwe
(for Apache Lucene MMapDirectory where a few bytes of heap space bind up to terabytes of mmap fulltext index data ��)




More information about the core-libs-dev mailing list