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

    *** old/src/share/vm/runtime/safepoint.cpp	Wed Feb 18 10:20:48 2015
    --- new/src/share/vm/runtime/safepoint.cpp	Wed Feb 18 10:20:48 2015

    *** 49,58 ****
    --- 49,59 ----
      #include "runtime/stubRoutines.hpp"
      #include "runtime/sweeper.hpp"
      #include "runtime/synchronizer.hpp"
      #include "runtime/thread.inline.hpp"
      #include "services/runtimeService.hpp"
    + #include "trace/tracing.hpp"
      #include "utilities/events.hpp"
      #include "utilities/macros.hpp"
      #ifdef TARGET_ARCH_x86
      # include "nativeInst_x86.hpp"
      # include "vmreg_x86.inline.hpp"

    *** 500,511 ****
    --- 501,510 ----
        // Need a safepoint if some inline cache buffers is non-empty
        if (!InlineCacheBuffer::is_empty()) return true;
        return false;
      }

      // Various cleaning tasks that should be done periodically at safepoints
      void SafepointSynchronize::do_cleanup_tasks() {
        {
          TraceTime t1("deflating idle monitors", TraceSafepointCleanupTime);
          ObjectSynchronizer::deflate_idle_monitors();

    *** 513,539 ****
    --- 512,649 ----

        {
          TraceTime t2("updating inline caches", TraceSafepointCleanupTime);
          InlineCacheBuffer::update_inline_caches();
        }
    +
        {
          TraceTime t3("compilation policy safepoint handler", TraceSafepointCleanupTime);
          CompilationPolicy::policy()->do_safepoint_work();
        }

        {
          TraceTime t4("mark nmethods", TraceSafepointCleanupTime);
          NMethodSweeper::mark_active_nmethods();
        }

    + //#define PRINT_RESIZE
    +
    +   if (HashtablesResizeSymbolTable == true) {
    +     ResizeHashtableStats stats;
    +     {
    +       //tty->print("SymbolTable      ");
    +       TraceTime t5("resize_table for SymbolTable", TraceSafepointCleanupTime);
    +       EventSymbolTableResize event;
    +       stats = SymbolTable::the_table()->resize_table(SymbolTable_lock,
    +                                                       HashtablesResizeSymbolTableTriggerLoadFactor,
    +                                                         HashtablesResizeSymbolTableDesiredLoadFactor);
    +       if (stats.resized == true) {
    +         if (PrintSymbolTableStatisticsTimeline == true) {
    +           tty->print("-------------------------------------------------------------------------------\n");
    +           tty->print("SymbolTable resized from %d to %d\n", stats.old_size, stats.new_size);
    +           tty->print("-------------------------------------------------------------------------------\n");
    +         }
    +         if (event.should_commit() == true) {
    +           event.set_oldSize(stats.old_size);
    +           event.set_newSize(stats.new_size);
    +           event.commit();
    +         }
    +       }
    +     }
    +   }
    +
    +   if (HashtablesResizeStringTable == true) {
    +     ResizeHashtableStats stats;
    +     {
    +       //tty->print("StringTable      ");
    +       TraceTime t6("resize_table for StringTable", TraceSafepointCleanupTime);
    +       EventStringTableResize event;
    +       stats = StringTable::the_table()->resize_table(StringTable_lock,
    +                                                       HashtablesResizeStringTableTriggerLoadFactor,
    +                                                         HashtablesResizeStringTableDesiredLoadFactor);
    +       if (stats.resized == true) {
    +         if (PrintStringTableStatisticsTimeline == true) {
    +           tty->print("-------------------------------------------------------------------------------\n");
    +           tty->print("StringTable resized from %d to %d\n", stats.old_size, stats.new_size);
    +           tty->print("-------------------------------------------------------------------------------\n");
    +         }
    +         if (event.should_commit() == true) {
    +           event.set_oldSize(stats.old_size);
    +           event.set_newSize(stats.new_size);
    +           event.commit();
    +         }
    +       }
    +     }
    +   }
    +
    +   if (HashtablesResizeSystemDictionary == true) {
    +     ResizeHashtableStats stats;
    +     {
    +       //tty->print("SystemDictionary ");
    +       TraceTime t6("resize_table for SystemDictionary", TraceSafepointCleanupTime);
    +       EventSystemDictionaryResize event;
    +       stats = SystemDictionary::the_table()->resize_table(SystemDictionary_lock,
    +                                                             HashtablesResizeSystemDictionaryTriggerLoadFactor,
    +                                                               HashtablesResizeSystemDictionaryDesiredLoadFactor);
    +       if (stats.resized == true) {
    +         if (PrintStringTableStatisticsTimeline == true) {
    +           tty->print("-------------------------------------------------------------------------------\n");
    +           tty->print("SystemDictionary resized from %d to %d\n", stats.old_size, stats.new_size);
    +           tty->print("-------------------------------------------------------------------------------\n");
    +         }
    +         if (event.should_commit() == true) {
    +           event.set_oldSize(stats.old_size);
    +           event.set_newSize(stats.new_size);
    +           event.commit();
    +         }
    +       }
    +     }
    +   }
    +
    +   {
    +     bool wants = false;
    +     bool reported = false;
    +     static int skip = 1000;
    +     if (PrintSymbolTableStatisticsTimeline == true) {
    +       wants = true;
    +       static int number_of_entries = 0;
    +       if (SymbolTable::the_table()->number_of_entries() > (skip+number_of_entries)) {
    +         number_of_entries = SymbolTable::the_table()->number_of_entries();
    +         tty->print("SymbolTable      %9d:%6.3f:%lld\n", number_of_entries, (float)number_of_entries/(float)SymbolTable::the_table()->table_size(), os::javaTimeNanos());
    +         reported = true;
    +       }
    +     }
    +     if (PrintStringTableStatisticsTimeline == true) {
    +       wants = true;
    +       static int number_of_entries = 0;
    +       if (StringTable::the_table()->number_of_entries() > (skip+number_of_entries)) {
    +         number_of_entries = StringTable::the_table()->number_of_entries();
    +         tty->print("StringTable      %9d:%6.3f:%lld\n", number_of_entries, (float)number_of_entries/(float)SymbolTable::the_table()->table_size(), os::javaTimeNanos());
    +         reported = true;
    +       }
    +     }
    +     if (PrintSystemDictionaryStatisticsTimeline == true) {
    +       wants = true;
    +       static int number_of_entries = 0;
    +       if (SystemDictionary::the_table()->number_of_entries() > (skip+number_of_entries)) {
    +         number_of_entries = SystemDictionary::the_table()->number_of_entries();
    +         tty->print("SystemDictionary %9d:%6.3f:%lld\n", number_of_entries, (float)number_of_entries/(float)SymbolTable::the_table()->table_size(), os::javaTimeNanos());
    +         reported = true;
    +       }
    +     }
    +     if ((wants == true) && (reported == false)) {
    +       tty->print(".\n");
    +     }
    +   }
    +
        if (SymbolTable::needs_rehashing()) {
    !     TraceTime t5("rehashing symbol table", TraceSafepointCleanupTime);
    !     TraceTime t8("rehashing symbol table", TraceSafepointCleanupTime);
          SymbolTable::rehash_table();
        }

        if (StringTable::needs_rehashing()) {
    !     TraceTime t6("rehashing string table", TraceSafepointCleanupTime);
    !     TraceTime t9("rehashing string table", TraceSafepointCleanupTime);
          StringTable::rehash_table();
        }

        // rotate log files?
        if (UseGCLogFileRotation) {

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