[OpenJDK 2D-Dev] Cleaner usage in java2 / awt

Jim Graham james.graham at oracle.com
Fri Jan 8 23:38:12 UTC 2016


We should probably be looking to replace Java2D's Disposer with the new 
Cleaner.  The reason that we didn't use the prior non-public Cleaner was 
that it didn't support all reference types and we were using (I think) 
Phantom references?  I think the new public Cleaner is more configurable 
so we should look into it again.

In the meantime, if the new Cleaner mechanism meets your needs then 
please do use it...

			...jim

On 1/8/16 1:00 PM, Laurent Bourgès wrote:
> Phil,
>
> I started changing the Marlin OffHeapArray class to use the new jdk
> internal Cleaner instead of my own solution (ReferenceQueue +
> PhantomReference + Thread). Or should I use the java2d Disposer instead ?
>
> It seems working well and many lines are removed.
>
> Do you plan adding a shared Cleaner instance (Thread) for java2d as the
> java.base module will have ?
>
> Probably it is also applicable to the sun.java2d.Disposer ?
>
> It would reduce the number of running threads to dispose / free resources !
>
> Regards,
> Laurent
>



More information about the 2d-dev mailing list