< prev index next >

src/share/vm/services/heapDumper.cpp

Print this page




1808   // of the heap dump.
1809   HeapObjectDumper obj_dumper(this, writer());
1810   Universe::heap()->safe_object_iterate(&obj_dumper);
1811 
1812   // HPROF_GC_ROOT_THREAD_OBJ + frames + jni locals
1813   do_threads();
1814   check_segment_length();
1815 
1816   // HPROF_GC_ROOT_MONITOR_USED
1817   MonitorUsedDumper mon_dumper(writer());
1818   ObjectSynchronizer::oops_do(&mon_dumper);
1819   check_segment_length();
1820 
1821   // HPROF_GC_ROOT_JNI_GLOBAL
1822   JNIGlobalsDumper jni_dumper(writer());
1823   JNIHandles::oops_do(&jni_dumper);
1824   check_segment_length();
1825 
1826   // HPROF_GC_ROOT_STICKY_CLASS
1827   StickyClassDumper class_dumper(writer());
1828   SystemDictionary::always_strong_classes_do(&class_dumper);

1829 
1830   // fixes up the length of the dump record and writes the HPROF_HEAP_DUMP_END record.
1831   DumperSupport::end_of_dump(writer());
1832 
1833   // Now we clear the global variables, so that a future dumper might run.
1834   clear_global_dumper();
1835   clear_global_writer();
1836 }
1837 
1838 void VM_HeapDumper::dump_stack_traces() {
1839   // write a HPROF_TRACE record without any frames to be referenced as object alloc sites
1840   DumperSupport::write_header(writer(), HPROF_TRACE, 3*sizeof(u4));
1841   writer()->write_u4((u4) STACK_TRACE_ID);
1842   writer()->write_u4(0);                    // thread number
1843   writer()->write_u4(0);                    // frame count
1844 
1845   _stack_traces = NEW_C_HEAP_ARRAY(ThreadStackTrace*, Threads::number_of_threads(), mtInternal);
1846   int frame_serial_num = 0;
1847   for (JavaThread* thread = Threads::first(); thread != NULL ; thread = thread->next()) {
1848     oop threadObj = thread->threadObj();




1808   // of the heap dump.
1809   HeapObjectDumper obj_dumper(this, writer());
1810   Universe::heap()->safe_object_iterate(&obj_dumper);
1811 
1812   // HPROF_GC_ROOT_THREAD_OBJ + frames + jni locals
1813   do_threads();
1814   check_segment_length();
1815 
1816   // HPROF_GC_ROOT_MONITOR_USED
1817   MonitorUsedDumper mon_dumper(writer());
1818   ObjectSynchronizer::oops_do(&mon_dumper);
1819   check_segment_length();
1820 
1821   // HPROF_GC_ROOT_JNI_GLOBAL
1822   JNIGlobalsDumper jni_dumper(writer());
1823   JNIHandles::oops_do(&jni_dumper);
1824   check_segment_length();
1825 
1826   // HPROF_GC_ROOT_STICKY_CLASS
1827   StickyClassDumper class_dumper(writer());
1828   ClassLoaderData::the_null_class_loader_data()->classes_do(&class_dumper);
1829   //SystemDictionary::always_strong_classes_do(&class_dumper);
1830 
1831   // fixes up the length of the dump record and writes the HPROF_HEAP_DUMP_END record.
1832   DumperSupport::end_of_dump(writer());
1833 
1834   // Now we clear the global variables, so that a future dumper might run.
1835   clear_global_dumper();
1836   clear_global_writer();
1837 }
1838 
1839 void VM_HeapDumper::dump_stack_traces() {
1840   // write a HPROF_TRACE record without any frames to be referenced as object alloc sites
1841   DumperSupport::write_header(writer(), HPROF_TRACE, 3*sizeof(u4));
1842   writer()->write_u4((u4) STACK_TRACE_ID);
1843   writer()->write_u4(0);                    // thread number
1844   writer()->write_u4(0);                    // frame count
1845 
1846   _stack_traces = NEW_C_HEAP_ARRAY(ThreadStackTrace*, Threads::number_of_threads(), mtInternal);
1847   int frame_serial_num = 0;
1848   for (JavaThread* thread = Threads::first(); thread != NULL ; thread = thread->next()) {
1849     oop threadObj = thread->threadObj();


< prev index next >