Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 6121:b9442ac22f59
7173460: G1: java/lang/management/MemoryMXBean/CollectionUsageThreshold.java failes with G1
Summary: The scope of TraceMemoryManagerStats in G1CollectedHeap need to cover the call to G1MonitoringSupport::update_sizes()
Reviewed-by: johnc, jmasa
author | brutisso |
---|---|
date | Mon, 04 Jun 2012 13:29:34 +0200 |
parents | 37552638d24a |
children | 7994a5a35fcf d2a62e0f25eb |
comparison
equal
deleted
inserted
replaced
6120:37552638d24a | 6121:b9442ac22f59 |
---|---|
1491 | 1491 |
1492 // Discard all rset updates | 1492 // Discard all rset updates |
1493 JavaThread::dirty_card_queue_set().abandon_logs(); | 1493 JavaThread::dirty_card_queue_set().abandon_logs(); |
1494 assert(!G1DeferredRSUpdate | 1494 assert(!G1DeferredRSUpdate |
1495 || (G1DeferredRSUpdate && (dirty_card_queue_set().completed_buffers_num() == 0)), "Should not be any"); | 1495 || (G1DeferredRSUpdate && (dirty_card_queue_set().completed_buffers_num() == 0)), "Should not be any"); |
1496 } | 1496 |
1497 | 1497 _young_list->reset_sampled_info(); |
1498 _young_list->reset_sampled_info(); | 1498 // At this point there should be no regions in the |
1499 // At this point there should be no regions in the | 1499 // entire heap tagged as young. |
1500 // entire heap tagged as young. | 1500 assert( check_young_list_empty(true /* check_heap */), |
1501 assert( check_young_list_empty(true /* check_heap */), | 1501 "young list should be empty at this point"); |
1502 "young list should be empty at this point"); | 1502 |
1503 | 1503 // Update the number of full collections that have been completed. |
1504 // Update the number of full collections that have been completed. | 1504 increment_old_marking_cycles_completed(false /* concurrent */); |
1505 increment_old_marking_cycles_completed(false /* concurrent */); | 1505 |
1506 | 1506 _hrs.verify_optional(); |
1507 _hrs.verify_optional(); | 1507 verify_region_sets_optional(); |
1508 verify_region_sets_optional(); | 1508 |
1509 | 1509 print_heap_after_gc(); |
1510 print_heap_after_gc(); | 1510 |
1511 g1mm()->update_sizes(); | 1511 // We must call G1MonitoringSupport::update_sizes() in the same scoping level |
1512 // as an active TraceMemoryManagerStats object (i.e. before the destructor for the | |
1513 // TraceMemoryManagerStats is called) so that the G1 memory pools are updated | |
1514 // before any GC notifications are raised. | |
1515 g1mm()->update_sizes(); | |
1516 } | |
1517 | |
1512 post_full_gc_dump(); | 1518 post_full_gc_dump(); |
1513 | 1519 |
1514 return true; | 1520 return true; |
1515 } | 1521 } |
1516 | 1522 |
3934 ParallelTaskTerminator::print_termination_counts(); | 3940 ParallelTaskTerminator::print_termination_counts(); |
3935 #endif | 3941 #endif |
3936 | 3942 |
3937 gc_epilogue(false); | 3943 gc_epilogue(false); |
3938 } | 3944 } |
3939 } | 3945 |
3940 | 3946 // The closing of the inner scope, immediately above, will complete |
3941 // The closing of the inner scope, immediately above, will complete | 3947 // logging at the "fine" level. The record_collection_pause_end() call |
3942 // logging at the "fine" level. The record_collection_pause_end() call | 3948 // above will complete logging at the "finer" level. |
3943 // above will complete logging at the "finer" level. | 3949 // |
3944 // | 3950 // It is not yet to safe, however, to tell the concurrent mark to |
3945 // It is not yet to safe, however, to tell the concurrent mark to | 3951 // start as we have some optional output below. We don't want the |
3946 // start as we have some optional output below. We don't want the | 3952 // output from the concurrent mark thread interfering with this |
3947 // output from the concurrent mark thread interfering with this | 3953 // logging output either. |
3948 // logging output either. | 3954 |
3949 | 3955 _hrs.verify_optional(); |
3950 _hrs.verify_optional(); | 3956 verify_region_sets_optional(); |
3951 verify_region_sets_optional(); | 3957 |
3952 | 3958 TASKQUEUE_STATS_ONLY(if (ParallelGCVerbose) print_taskqueue_stats()); |
3953 TASKQUEUE_STATS_ONLY(if (ParallelGCVerbose) print_taskqueue_stats()); | 3959 TASKQUEUE_STATS_ONLY(reset_taskqueue_stats()); |
3954 TASKQUEUE_STATS_ONLY(reset_taskqueue_stats()); | 3960 |
3955 | 3961 print_heap_after_gc(); |
3956 print_heap_after_gc(); | 3962 |
3957 g1mm()->update_sizes(); | 3963 // We must call G1MonitoringSupport::update_sizes() in the same scoping level |
3964 // as an active TraceMemoryManagerStats object (i.e. before the destructor for the | |
3965 // TraceMemoryManagerStats is called) so that the G1 memory pools are updated | |
3966 // before any GC notifications are raised. | |
3967 g1mm()->update_sizes(); | |
3968 } | |
3958 | 3969 |
3959 if (G1SummarizeRSetStats && | 3970 if (G1SummarizeRSetStats && |
3960 (G1SummarizeRSetStatsPeriod > 0) && | 3971 (G1SummarizeRSetStatsPeriod > 0) && |
3961 (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { | 3972 (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { |
3962 g1_rem_set()->print_summary_info(); | 3973 g1_rem_set()->print_summary_info(); |