Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp @ 14518:d8041d695d19
Merged with jdk9/dev/hotspot changeset 3812c088b945
author | twisti |
---|---|
date | Tue, 11 Mar 2014 18:45:59 -0700 |
parents | 44315152d434 |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14141:f97c5ec83832 | 14518:d8041d695d19 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2002, 2014, 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. |
464 } else { | 464 } else { |
465 reference_processor()->enqueue_discovered_references(NULL); | 465 reference_processor()->enqueue_discovered_references(NULL); |
466 } | 466 } |
467 } | 467 } |
468 | 468 |
469 GCTraceTime tm("StringTable", false, false, &_gc_timer); | 469 { |
470 // Unlink any dead interned Strings and process the remaining live ones. | 470 GCTraceTime tm("StringTable", false, false, &_gc_timer); |
471 PSScavengeRootsClosure root_closure(promotion_manager); | 471 // Unlink any dead interned Strings and process the remaining live ones. |
472 StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure); | 472 PSScavengeRootsClosure root_closure(promotion_manager); |
473 StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure); | |
474 } | |
473 | 475 |
474 // Finally, flush the promotion_manager's labs, and deallocate its stacks. | 476 // Finally, flush the promotion_manager's labs, and deallocate its stacks. |
475 promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer); | 477 promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer); |
476 if (promotion_failure_occurred) { | 478 if (promotion_failure_occurred) { |
477 clean_up_failed_promotion(); | 479 clean_up_failed_promotion(); |
525 counters->update_survived(survived); | 527 counters->update_survived(survived); |
526 counters->update_promoted(promoted); | 528 counters->update_promoted(promoted); |
527 counters->update_survivor_overflowed(_survivor_overflow); | 529 counters->update_survivor_overflowed(_survivor_overflow); |
528 } | 530 } |
529 | 531 |
532 size_t max_young_size = young_gen->max_size(); | |
533 | |
534 // Deciding a free ratio in the young generation is tricky, so if | |
535 // MinHeapFreeRatio or MaxHeapFreeRatio are in use (implicating | |
536 // that the old generation size may have been limited because of them) we | |
537 // should then limit our young generation size using NewRatio to have it | |
538 // follow the old generation size. | |
539 if (MinHeapFreeRatio != 0 || MaxHeapFreeRatio != 100) { | |
540 max_young_size = MIN2(old_gen->capacity_in_bytes() / NewRatio, young_gen->max_size()); | |
541 } | |
542 | |
530 size_t survivor_limit = | 543 size_t survivor_limit = |
531 size_policy->max_survivor_size(young_gen->max_size()); | 544 size_policy->max_survivor_size(max_young_size); |
532 _tenuring_threshold = | 545 _tenuring_threshold = |
533 size_policy->compute_survivor_space_size_and_threshold( | 546 size_policy->compute_survivor_space_size_and_threshold( |
534 _survivor_overflow, | 547 _survivor_overflow, |
535 _tenuring_threshold, | 548 _tenuring_threshold, |
536 survivor_limit); | 549 survivor_limit); |
549 } | 562 } |
550 | 563 |
551 // Do call at minor collections? | 564 // Do call at minor collections? |
552 // Don't check if the size_policy is ready at this | 565 // Don't check if the size_policy is ready at this |
553 // level. Let the size_policy check that internally. | 566 // level. Let the size_policy check that internally. |
554 if (UseAdaptiveSizePolicy && | 567 if (UseAdaptiveGenerationSizePolicyAtMinorCollection && |
555 UseAdaptiveGenerationSizePolicyAtMinorCollection && | |
556 ((gc_cause != GCCause::_java_lang_system_gc) || | 568 ((gc_cause != GCCause::_java_lang_system_gc) || |
557 UseAdaptiveSizePolicyWithSystemGC)) { | 569 UseAdaptiveSizePolicyWithSystemGC)) { |
558 | 570 |
559 // Calculate optimial free space amounts | 571 // Calculate optimal free space amounts |
560 assert(young_gen->max_size() > | 572 assert(young_gen->max_size() > |
561 young_gen->from_space()->capacity_in_bytes() + | 573 young_gen->from_space()->capacity_in_bytes() + |
562 young_gen->to_space()->capacity_in_bytes(), | 574 young_gen->to_space()->capacity_in_bytes(), |
563 "Sizes of space in young gen are out-of-bounds"); | 575 "Sizes of space in young gen are out-of-bounds"); |
564 | 576 |
565 size_t young_live = young_gen->used_in_bytes(); | 577 size_t young_live = young_gen->used_in_bytes(); |
566 size_t eden_live = young_gen->eden_space()->used_in_bytes(); | 578 size_t eden_live = young_gen->eden_space()->used_in_bytes(); |
567 size_t cur_eden = young_gen->eden_space()->capacity_in_bytes(); | 579 size_t cur_eden = young_gen->eden_space()->capacity_in_bytes(); |
568 size_t max_old_gen_size = old_gen->max_gen_size(); | 580 size_t max_old_gen_size = old_gen->max_gen_size(); |
569 size_t max_eden_size = young_gen->max_size() - | 581 size_t max_eden_size = max_young_size - |
570 young_gen->from_space()->capacity_in_bytes() - | 582 young_gen->from_space()->capacity_in_bytes() - |
571 young_gen->to_space()->capacity_in_bytes(); | 583 young_gen->to_space()->capacity_in_bytes(); |
572 | 584 |
573 // Used for diagnostics | 585 // Used for diagnostics |
574 size_policy->clear_generation_free_space_flags(); | 586 size_policy->clear_generation_free_space_flags(); |