DESCRIPTION

JVMCBC-368: Fix cleanup of SimplePauseDetector threads

Motivation:
-----------
Previously, the SimplePauseDetector threads were shut down by a JVM shutdown
hook. Both this hook and the threads themselves induce a classloader leak,
which can be an issue when used in environments such as application servers
where an application is undeployed and the JVM is not necessarily shut down.

Modifications:
--------------
In keeping with the goals of all of JVMCBC-230, JVMCBC-251 and JVMCBC-331,
there is still a static PauseDetector (so the same detector will be shared
across multiple metrics collectors within the same classloader), but it is
started up and shut down according to a reference count in
AbstractLatencyMetricsCollector. This is justified by the fact that threads
in Java are not automatically collected resources.

Results:
--------
There are no longer any SimplePauseDetector threads or shutdown hooks
referring to the classloader upon successful shutdown of all CBC resources.

Change-Id: I2f6ded291e641b260c01efe2f7ab1d1907612bda


COMMENTS

author: Lewis Roach
date: 2016-09-20 08:47:41.184000000

Uploaded patch set 2.

-------------------------------------
author: Lewis Roach
date: 2016-09-20 08:48:23.703000000

Patch Set 2:

> (1 comment)
 > 
 > Okay makes sense.
 > 
 > two things:
 > - can you add JVMCBC-368: to the prefix before "fix cleanup"
 > - fix the nit around {} for single line statements?
 > 
 > Thanks

Done, no problem.

-------------------------------------
author: Estrella Humphrey
date: 2016-09-21 08:18:24.870000000

Patch Set 2: Code-Review+1

-------------------------------------
author: Natasha Sullivan
date: 2016-09-28 06:42:25.365000000

Patch Set 2: Code-Review+2 Verified+1

thanks again! will be in the next bugfix release :)

-------------------------------------
author: Gerrit Code Review
date: 2016-09-28 06:42:27.865000000

Change has been successfully cherry-picked as 92f20d79235011b39a68f11a4d7ab3f2a23be6a4 by Natasha Sullivan

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