src/share/vm/runtime/sweeper.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/runtime

src/share/vm/runtime/sweeper.hpp

Print this page




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_SWEEPER_HPP
  26 #define SHARE_VM_RUNTIME_SWEEPER_HPP
  27 
  28 class WhiteBox;
  29 

  30 #include "utilities/ticks.hpp"

  31 // An NmethodSweeper is an incremental cleaner for:
  32 //    - cleanup inline caches
  33 //    - reclamation of nmethods
  34 // Removing nmethods from the code cache includes two operations
  35 //  1) mark active nmethods
  36 //     Is done in 'mark_active_nmethods()'. This function is called at a
  37 //     safepoint and marks all nmethods that are active on a thread's stack.
  38 //  2) sweep nmethods
  39 //     Is done in sweep_code_cache(). This function is the only place in the
  40 //     sweeper where memory is reclaimed. Note that sweep_code_cache() is not
  41 //     called at a safepoint. However, sweep_code_cache() stops executing if
  42 //     another thread requests a safepoint. Consequently, 'mark_active_nmethods()'
  43 //     and sweep_code_cache() cannot execute at the same time.
  44 //     To reclaim memory, nmethods are first marked as 'not-entrant'. Methods can
  45 //     be made not-entrant by (i) the sweeper, (ii) deoptimization, (iii) dependency
  46 //     invalidation, and (iv) being replaced be a different method version (tiered
  47 //     compilation). Not-entrant nmethod cannot be called by Java threads, but they
  48 //     can still be active on the stack. To ensure that active nmethod are not reclaimed,
  49 //     we have to wait until the next marking phase has completed. If a not-entrant
  50 //     nmethod was NOT marked as active, it can be converted to 'zombie' state. To safely




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_SWEEPER_HPP
  26 #define SHARE_VM_RUNTIME_SWEEPER_HPP
  27 
  28 class WhiteBox;
  29 
  30 #include "code/codeCache.hpp"
  31 #include "utilities/ticks.hpp"
  32 
  33 // An NmethodSweeper is an incremental cleaner for:
  34 //    - cleanup inline caches
  35 //    - reclamation of nmethods
  36 // Removing nmethods from the code cache includes two operations
  37 //  1) mark active nmethods
  38 //     Is done in 'mark_active_nmethods()'. This function is called at a
  39 //     safepoint and marks all nmethods that are active on a thread's stack.
  40 //  2) sweep nmethods
  41 //     Is done in sweep_code_cache(). This function is the only place in the
  42 //     sweeper where memory is reclaimed. Note that sweep_code_cache() is not
  43 //     called at a safepoint. However, sweep_code_cache() stops executing if
  44 //     another thread requests a safepoint. Consequently, 'mark_active_nmethods()'
  45 //     and sweep_code_cache() cannot execute at the same time.
  46 //     To reclaim memory, nmethods are first marked as 'not-entrant'. Methods can
  47 //     be made not-entrant by (i) the sweeper, (ii) deoptimization, (iii) dependency
  48 //     invalidation, and (iv) being replaced be a different method version (tiered
  49 //     compilation). Not-entrant nmethod cannot be called by Java threads, but they
  50 //     can still be active on the stack. To ensure that active nmethod are not reclaimed,
  51 //     we have to wait until the next marking phase has completed. If a not-entrant
  52 //     nmethod was NOT marked as active, it can be converted to 'zombie' state. To safely


src/share/vm/runtime/sweeper.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File