> Hi all,
> 
> Test com/sun/jdi/FinalizerTest.java intermittent fails. This is because 
> arraylist holdAlot do not clear or set as null before recliam heap memory by 
> invoke System.gc. This PR add arraylist.clear() before call System.gc() to 
> avoid OOME in the senond System.runFinalization().
> 
> The first System.runFinalization() has a synchronize bug. 
> System.runFinalization() run in another low priority Finalizer thread. In the 
> main thread maybe read variable finalizerRun before Finalizer thread change 
> it. So waitForAFinalizer will run into whille(true) allocation loop 
> sometimes. This PR add a countdownlatch synchronize to make sure main thread 
> read the finalizerRun value after Finalizer thread write it.
> 
> This PR also remove the unused variable and optimize the imports, and add 
> -Xmx256M to debuggee jvm process, this will make debuggee throw OOME steady 
> in large physical memory machine.
> 
> Before this PR, test failure probability about 1/30. After this PR test run 
> 3k times and all passed.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

SendaoYan has updated the pull request incrementally with one additional commit 
since the last revision:

  Add a comment "The Debuggee should not reach here in theory"

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/30829/files
  - new: https://git.openjdk.org/jdk/pull/30829/files/60729662..e08e63f9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=30829&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30829&range=04-05

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/30829.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30829/head:pull/30829

PR: https://git.openjdk.org/jdk/pull/30829

Reply via email to