[OpenJDK 2D-Dev]  Review Request: 8028486 java/awt/Window/WindowsLeak/WindowsLeak.java fails
Sergey.Bylokhov at oracle.com
Mon May 2 21:28:33 UTC 2016
On 03.05.16 0:07, Phil Race wrote:
>> And this is fine because we use only identity checks inside the
>> validate method. If the java object was deleted we should update the
>> native state anyway.
> Not sure how to read that. Do you mean there is always
> some amount of work to do anyway ?
An example: if we started the paint operation for some surface and set
the clip, then for the next paint operation we skip setting the surface
and clip if they "==" to the previous values. So if the old data were
deleted by GC will mean that we cannot draw to them(and these cached
references are not useful)
> Is there any value in doing the "nulling" in Anton's earlier version
> of the fix to be more prompt ?
The current change is one step-up in the chain of references, and the
nulling in the CGlayer code will leave the leak of surface.
> is BufferedContext only used by D3D & OGL ?
Yes, but I checked direct usage.
> I suggest to run a decent set of tests on these different pipelines
> to make sure no surprises ..
I already run all tests on my OSX. Will run jck on d3d, and notify if
there are issues.
>>> On 05/02/2016 01:26 PM, Sergey Bylokhov wrote:
>>>> Please review the fix for jdk9.
>>>> Bug evaluation was done by Anton:
>>>> This is a cross-platform bug it affects d3d/ogl pipelines. The problem
>>>> is that BufferedContex cached information to skip some native
>>>> reconfigurations. But this cache cause a memory leak if some
>>>> data(src/dst surfaces) was cached and there was no new rendering in
>>>> this context(we create context per-d3d_device/ogl_config).
>>>> In the fix I changed all these caches to weak references. Note that i
>>>> use a references as initial values instead of null, just to eliminate
>>>> the null checks in the body of the method.
>>>> The test was updated to be more stable(flushed the EDT + flushed the
>>>> Disposer thread).
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8028486
>>>> Webrev can be found at:
Best regards, Sergey.
More information about the 2d-dev