GCThreadLeakPreventer (Jetty :: Aggregate :: All core Jetty 7.6.8.v20121106 API)
Date: 2012-11-06

org.eclipse.jetty.util.preventers

## Class GCThreadLeakPreventer

- java.lang.Object
- - org.eclipse.jetty.util.component.AbstractLifeCycle
  - - org.eclipse.jetty.util.preventers.AbstractLeakPreventer
    - - org.eclipse.jetty.util.preventers.GCThreadLeakPreventer

- All Implemented Interfaces:
    LifeCycle

      public class GCThreadLeakPreventer
      extends AbstractLeakPreventer

  GCThreadLeakPreventer Prevents a call to sun.misc.GC.requestLatency pinning a webapp classloader by calling it with a non-webapp classloader. The problem appears to be that when this method is called, a daemon thread is created which takes the context classloader. A known caller of this method is the RMI impl. See http://stackoverflow.com/questions/6626680/does-java-garbage-collection-log-entry-full-gc-system-mean-some-class-called This preventer will start the thread with the longest possible interval, although subsequent calls can vary that. Recommend to only use this class if you're doing RMI. Inspired by Tomcat JreMemoryLeakPrevention.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `AbstractLifeCycle.AbstractLifeCycleListener`

    - ### Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

      `LifeCycle.Listener`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.jetty.util.preventers.AbstractLeakPreventer

      `LOG`

    - ### Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GCThreadLeakPreventer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `prevent(ClassLoader loader)`

    - ### Methods inherited from class org.eclipse.jetty.util.preventers.AbstractLeakPreventer

      `doStart`

    - ### Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `addLifeCycleListener, doStop, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GCThreadLeakPreventer

          public GCThreadLeakPreventer()

  - ### Method Detail

    - #### prevent

          public void prevent(ClassLoader loader)

      Specified by:
        `prevent` in class `AbstractLeakPreventer`
      See Also:
        `AbstractLeakPreventer.prevent(java.lang.ClassLoader)`

Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.