RFR: 8244579: Windows "User Objects" leakage with WebView

2020-05-20 Thread Arun Joseph
Cause: The Window Class `RunLoopMessageWindow` is never registered (this 
happens because
registerRunLoopMessageWindowClass() is moved to MainThreadWin.cpp while openjfx 
uses MainThreadJava.cpp) and this
causes every setTimer() to create a new user object instead of reusing the same 
object over again.

Fix: Call registerRunLoopMessageWindowClass() from MainThreadJava.cpp

Test: To verify open any webpage using WebView on WIndows, with and without the 
fix and compare the number of user
objects created using Windows Task Manager.

-

Commit messages:
 - 8244579: Windows "User Objects" leakage with WebView

Changes: https://git.openjdk.java.net/jfx/pull/229/files
 Webrev: https://webrevs.openjdk.java.net/jfx/229/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8244579
  Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jfx/pull/229.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/229/head:pull/229

PR: https://git.openjdk.java.net/jfx/pull/229


Re: RFR: 8244579: Windows "User Objects" leakage with WebView

2020-05-20 Thread Kevin Rushforth
On Wed, 20 May 2020 14:30:11 GMT, Arun Joseph  wrote:

> Cause: The Window Class `RunLoopMessageWindow` is never registered (this 
> happens because
> registerRunLoopMessageWindowClass() is moved to MainThreadWin.cpp while 
> openjfx uses MainThreadJava.cpp) and this
> causes every SetTimer() call in
> [RunLoopWin.cpp](https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WTF/wtf/win/RunLoopWin.cpp)
> to create a new user object instead of reusing the same object over again.  
> Fix: Call
> registerRunLoopMessageWindowClass() from MainThreadJava.cpp  Test: To verify 
> open any webpage using WebView on WIndows,
> with and without the fix and compare the number of user objects created using 
> Windows Task Manager.

Is there a way to create a test?

-

PR: https://git.openjdk.java.net/jfx/pull/229


Re: RFR: 8244579: Windows "User Objects" leakage with WebView

2020-05-20 Thread Johan Vos
On Wed, 20 May 2020 19:17:28 GMT, Arun Joseph  wrote:

>> Is there a way to create a test?
>
> I think it will be difficult to write a test for this. While debugging, 
> RunLoop was mostly used by threads managing
> heap. It can't be directly accessed via JavaScript. Also, this issue only 
> affects Windows. The best way would be to
> monitor the user objects created.

https://bugs.openjdk.java.net/browse/JDK-8244579 refers to a manual test, but 
it's probably very hard to automate this.

-

PR: https://git.openjdk.java.net/jfx/pull/229


Re: RFR: 8244579: Windows "User Objects" leakage with WebView

2020-05-20 Thread Arun Joseph
On Wed, 20 May 2020 15:16:11 GMT, Kevin Rushforth  wrote:

>> Cause: The Window Class `RunLoopMessageWindow` is never registered (this 
>> happens because
>> registerRunLoopMessageWindowClass() is moved to MainThreadWin.cpp while 
>> openjfx uses MainThreadJava.cpp) and this
>> causes every SetTimer() call in
>> [RunLoopWin.cpp](https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WTF/wtf/win/RunLoopWin.cpp)
>> to create a new user object instead of reusing the same object over again.  
>> Fix: Call
>> registerRunLoopMessageWindowClass() from MainThreadJava.cpp  Test: To verify 
>> open any webpage using WebView on WIndows,
>> with and without the fix and compare the number of user objects created 
>> using Windows Task Manager.
>
> Is there a way to create a test?

I think it will be difficult to write a test for this. While debugging, RunLoop 
was mostly used by threads managing
heap. It can't be directly accessed via JavaScript. Also, this issue only 
affects Windows. The best way would be to
monitor the user objects created.

-

PR: https://git.openjdk.java.net/jfx/pull/229


Re: RFR: 8244579: Windows "User Objects" leakage with WebView

2020-05-21 Thread Guru Hb
On Wed, 20 May 2020 14:30:11 GMT, Arun Joseph  wrote:

> Cause: The Window Class `RunLoopMessageWindow` is never registered (this 
> happens because
> registerRunLoopMessageWindowClass() is moved to MainThreadWin.cpp while 
> openjfx uses MainThreadJava.cpp) and this
> causes every SetTimer() call in
> [RunLoopWin.cpp](https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WTF/wtf/win/RunLoopWin.cpp)
> to create a new user object instead of reusing the same object over again.  
> Fix: Call
> registerRunLoopMessageWindowClass() from MainThreadJava.cpp  Test: To verify 
> open any webpage using WebView on WIndows,
> with and without the fix and compare the number of user objects created using 
> Windows Task Manager.

Looks good to me
Tested with your fix and ran Test case provided in JBS 
(WebViewUserObjectLeakage) didn't exceeds more than 50 user
objects (Which is same as in 14-GA build).

-

Marked as reviewed by ghb (Reviewer).

PR: https://git.openjdk.java.net/jfx/pull/229


Re: RFR: 8244579: Windows "User Objects" leakage with WebView

2020-05-21 Thread Kevin Rushforth
On Wed, 20 May 2020 14:30:11 GMT, Arun Joseph  wrote:

> Cause: The Window Class `RunLoopMessageWindow` is never registered (this 
> happens because
> registerRunLoopMessageWindowClass() is moved to MainThreadWin.cpp while 
> openjfx uses MainThreadJava.cpp) and this
> causes every SetTimer() call in
> [RunLoopWin.cpp](https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WTF/wtf/win/RunLoopWin.cpp)
> to create a new user object instead of reusing the same object over again.  
> Fix: Call
> registerRunLoopMessageWindowClass() from MainThreadJava.cpp  Test: To verify 
> open any webpage using WebView on WIndows,
> with and without the fix and compare the number of user objects created using 
> Windows Task Manager.

Marked as reviewed by kcr (Lead).

-

PR: https://git.openjdk.java.net/jfx/pull/229


Re: [Integrated] RFR: 8244579: Windows "User Objects" leakage with WebView

2020-05-21 Thread Arun Joseph
On Wed, 20 May 2020 14:30:11 GMT, Arun Joseph  wrote:

> Cause: The Window Class `RunLoopMessageWindow` is never registered (this 
> happens because
> registerRunLoopMessageWindowClass() is moved to MainThreadWin.cpp while 
> openjfx uses MainThreadJava.cpp) and this
> causes every SetTimer() call in
> [RunLoopWin.cpp](https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WTF/wtf/win/RunLoopWin.cpp)
> to create a new user object instead of reusing the same object over again.  
> Fix: Call
> registerRunLoopMessageWindowClass() from MainThreadJava.cpp  Test: To verify 
> open any webpage using WebView on WIndows,
> with and without the fix and compare the number of user objects created using 
> Windows Task Manager.

This pull request has now been integrated.

Changeset: a13a642d
Author:Arun Joseph 
URL:   https://git.openjdk.java.net/jfx/commit/a13a642d
Stats: 4 lines in 1 file changed: 0 ins; 4 del; 0 mod

8244579: Windows "User Objects" leakage with WebView

Reviewed-by: ghb, kcr

-

PR: https://git.openjdk.java.net/jfx/pull/229