Mercurial > hg > graal-compiler
comparison src/share/vm/memory/genCollectedHeap.cpp @ 10405:f2110083203d
8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author | sla |
---|---|
date | Mon, 10 Jun 2013 11:30:51 +0200 |
parents | b06ac540229e |
children | 71180a6e5080 |
comparison
equal
deleted
inserted
replaced
10404:d0add7016434 | 10405:f2110083203d |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
26 #include "classfile/symbolTable.hpp" | 26 #include "classfile/symbolTable.hpp" |
27 #include "classfile/systemDictionary.hpp" | 27 #include "classfile/systemDictionary.hpp" |
28 #include "classfile/vmSymbols.hpp" | 28 #include "classfile/vmSymbols.hpp" |
29 #include "code/icBuffer.hpp" | 29 #include "code/icBuffer.hpp" |
30 #include "gc_implementation/shared/collectorCounters.hpp" | 30 #include "gc_implementation/shared/collectorCounters.hpp" |
31 #include "gc_implementation/shared/gcTraceTime.hpp" | |
31 #include "gc_implementation/shared/vmGCOperations.hpp" | 32 #include "gc_implementation/shared/vmGCOperations.hpp" |
32 #include "gc_interface/collectedHeap.inline.hpp" | 33 #include "gc_interface/collectedHeap.inline.hpp" |
33 #include "memory/filemap.hpp" | 34 #include "memory/filemap.hpp" |
34 #include "memory/gcLocker.inline.hpp" | 35 #include "memory/gcLocker.inline.hpp" |
35 #include "memory/genCollectedHeap.hpp" | 36 #include "memory/genCollectedHeap.hpp" |
386 | 387 |
387 bool complete = full && (max_level == (n_gens()-1)); | 388 bool complete = full && (max_level == (n_gens()-1)); |
388 const char* gc_cause_prefix = complete ? "Full GC" : "GC"; | 389 const char* gc_cause_prefix = complete ? "Full GC" : "GC"; |
389 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); | 390 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); |
390 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); | 391 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); |
391 TraceTime t(GCCauseString(gc_cause_prefix, gc_cause()), PrintGCDetails, false, gclog_or_tty); | 392 GCTraceTime t(GCCauseString(gc_cause_prefix, gc_cause()), PrintGCDetails, false, NULL); |
392 | 393 |
393 gc_prologue(complete); | 394 gc_prologue(complete); |
394 increment_total_collections(complete); | 395 increment_total_collections(complete); |
395 | 396 |
396 size_t gch_prev_used = used(); | 397 size_t gch_prev_used = used(); |
415 if (i == n_gens() - 1) { // a major collection is to happen | 416 if (i == n_gens() - 1) { // a major collection is to happen |
416 if (!complete) { | 417 if (!complete) { |
417 // The full_collections increment was missed above. | 418 // The full_collections increment was missed above. |
418 increment_total_full_collections(); | 419 increment_total_full_collections(); |
419 } | 420 } |
420 pre_full_gc_dump(); // do any pre full gc dumps | 421 pre_full_gc_dump(NULL); // do any pre full gc dumps |
421 } | 422 } |
422 // Timer for individual generations. Last argument is false: no CR | 423 // Timer for individual generations. Last argument is false: no CR |
423 TraceTime t1(_gens[i]->short_name(), PrintGCDetails, false, gclog_or_tty); | 424 // FIXME: We should try to start the timing earlier to cover more of the GC pause |
425 GCTraceTime t1(_gens[i]->short_name(), PrintGCDetails, false, NULL); | |
424 TraceCollectorStats tcs(_gens[i]->counters()); | 426 TraceCollectorStats tcs(_gens[i]->counters()); |
425 TraceMemoryManagerStats tmms(_gens[i]->kind(),gc_cause()); | 427 TraceMemoryManagerStats tmms(_gens[i]->kind(),gc_cause()); |
426 | 428 |
427 size_t prev_used = _gens[i]->used(); | 429 size_t prev_used = _gens[i]->used(); |
428 _gens[i]->stat_record()->invocations++; | 430 _gens[i]->stat_record()->invocations++; |
532 // for instance, a promotion failure could have led to | 534 // for instance, a promotion failure could have led to |
533 // a whole heap collection. | 535 // a whole heap collection. |
534 complete = complete || (max_level_collected == n_gens() - 1); | 536 complete = complete || (max_level_collected == n_gens() - 1); |
535 | 537 |
536 if (complete) { // We did a "major" collection | 538 if (complete) { // We did a "major" collection |
537 post_full_gc_dump(); // do any post full gc dumps | 539 // FIXME: See comment at pre_full_gc_dump call |
540 post_full_gc_dump(NULL); // do any post full gc dumps | |
538 } | 541 } |
539 | 542 |
540 if (PrintGCDetails) { | 543 if (PrintGCDetails) { |
541 print_heap_change(gch_prev_used); | 544 print_heap_change(gch_prev_used); |
542 | 545 |