Request for review: 7124524 - OutOfMemory exception after (or even before) some 2500 creations of LWWindowPeer

Sergey Bylokhov sergey.bylokhov at oracle.com
Tue Jan 17 06:56:17 PST 2012


17.01.2012 18:09, Artem Ananiev wrote:
> Hi, Sergey,
>
> see my comments inline.
>
> On 1/17/2012 5:02 PM, Sergey Bylokhov wrote:
>> Hi Everyone,
>> This is a fix for 4 memory leaks.
>> 1. LWWindowPeer does not destroy backbuffer in disposeImpl().
>
> Should the old SurfaceData be flushed as well?
it is invalidated in disposeImpl(). It implemented in this way on 
Windows and Linux too.
>
>> 2. LWToolkit stores unused links to Peer.
>> 3. Local references were not deleted in the AWTWindow.m, but according
>> JNFJObjectWrapper.jObjectWithEnv documentation "returns a new local-ref,
>> must be released with DeleteLocalRef".
>> 4. OGLContext in some cases can cache CGLSurfaceData in this case our
>> LWWindowPeer was not collected.
>
> I see the pView field is cleared in the invalidate() method of 
> CGLWindowSurfaceData. There are other subclasses of CGLSurfaceData 
> which may require changing as well.
pView  is not used there.
>
>> Bug: http://monaco.us.oracle.com/detail.jsf?cr=7124524
>> Webrev can be found at: 
>> http://cr.openjdk.java.net/~serb/7124524/webrev.00/
>
> Thanks,
>
> Artem


-- 
Best regards, Sergey.



More information about the macosx-port-dev mailing list