< prev index next >

src/hotspot/share/runtime/sweeper.cpp

Print this page
*** 196,10 ***
--- 196,12 ---
    * This function triggers a VM operation that does stack scanning of active
    * methods. Stack scanning is mandatory for the sweeper to make progress.
    */
  void NMethodSweeper::do_stack_scanning() {
    assert(!CodeCache_lock->owned_by_self(), "just checking");
+   // There are stacks in the heap that need to be scanned.
+   Universe::heap()->collect_for_codecache();
    if (wait_for_stack_scanning()) {
      CodeBlobClosure* code_cl;
      {
        MutexLocker ccl(CodeCache_lock, Mutex::_no_safepoint_check_flag);
        code_cl = prepare_mark_active_nmethods();
< prev index next >