Reset interrupted flag in SingleThreadEventLoopTest. Fixes #2841

Motivation:

Once the interrupted flag in SingleThreadEventLoopB was set it was never reset.
That way the eventloop thread was always in an interrupted state and all calls
to Thread.sleep/LockSupport.parkNanos would fail.

Modifications:

Reset interrupted flag.

Result:

Number of GC runs when executing the test is down to zero (from 20 - 50).
Looking at the heap dump shows >10x decrease in memory consumption e.g.
the number of ForkJoinTasks is down to 25k from 350k previously. Similar
is true for BlockingQueue.Node objects.
This commit is contained in:
Jakob Buchgraber 2014-09-01 16:10:45 +02:00 committed by Norman Maurer
parent 6104e44c76
commit c40b0d2e07

View File

@ -738,6 +738,7 @@ public class SingleThreadEventLoopTest {
if (interrupted) {
thread.interrupt();
interrupted = false;
}
// We use LockSupport.parkNanos() and NOT Thread.sleep() to eliminate the overhead of creating a new