RFR: 8332154: Memory leak in SynchronousQueue
Vitaly Provodin
duke at openjdk.org
Fri May 17 08:35:03 UTC 2024
On Thu, 16 May 2024 15:06:45 GMT, Viktor Klang <vklang at openjdk.org> wrote:
>> Local testing seems to indicate that this fix (which mirrors what's done in the FIFO mode) addresses the problem.
>>
>> But with that said, I haven't come up with a decent way of adding some form of regression test. Suggestions are most welcome. /cc @DougLea
>
> @AlanBateman @DougLea Reviews are most welcome :)
Hi @viktorklang-ora
The changes was verified as follows
1. Create the script launching the test (from bug description) in a loop and calculating the number of failures.
cat <<EOF >runme.sh
#!/bin/bash -x
__test_jdk=$1
__test=$2
__count=${3:-20}
i=0
failures=0
while true; do
((i=i+1))
echo i: $i
$__test_jdk/bin/java \
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
$__test || break
if [ "$i" -ge "$__count" ]; then
break
fi
done
EOF
2. Launch the test as follows
bash runme.sh ${test_jdk_home} Main 100
When the test is launched 100 times it is guaranteed to fail in at least one iteration. With this fix no failures were detected in 1000 runs.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19271#issuecomment-2116560270
More information about the core-libs-dev
mailing list