1 /*
2 * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
413 reference_processor()->setup_policy(false); // not always_clear
414 reference_processor()->set_active_mt_degree(active_workers);
415 PSKeepAliveClosure keep_alive(promotion_manager);
416 PSEvacuateFollowersClosure evac_followers(promotion_manager);
417 ReferenceProcessorStats stats;
418 if (reference_processor()->processing_is_mt()) {
419 PSRefProcTaskExecutor task_executor;
420 stats = reference_processor()->process_discovered_references(
421 &_is_alive_closure, &keep_alive, &evac_followers, &task_executor,
422 &_gc_timer);
423 } else {
424 stats = reference_processor()->process_discovered_references(
425 &_is_alive_closure, &keep_alive, &evac_followers, NULL, &_gc_timer);
426 }
427
428 _gc_tracer.report_gc_reference_stats(stats);
429
430 // Enqueue reference objects discovered during scavenge.
431 if (reference_processor()->processing_is_mt()) {
432 PSRefProcTaskExecutor task_executor;
433 reference_processor()->enqueue_discovered_references(&task_executor);
434 } else {
435 reference_processor()->enqueue_discovered_references(NULL);
436 }
437 }
438
439 {
440 GCTraceTime(Debug, gc, phases) tm("Scrub String Table", &_gc_timer);
441 // Unlink any dead interned Strings and process the remaining live ones.
442 PSScavengeRootsClosure root_closure(promotion_manager);
443 StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure);
444 }
445
446 // Finally, flush the promotion_manager's labs, and deallocate its stacks.
447 promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer);
448 if (promotion_failure_occurred) {
449 clean_up_failed_promotion();
450 log_info(gc, promotion)("Promotion failed");
451 }
452
453 _gc_tracer.report_tenuring_threshold(tenuring_threshold());
454
455 // Let the size policy know we're done. Note that we count promotion
|
1 /*
2 * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
413 reference_processor()->setup_policy(false); // not always_clear
414 reference_processor()->set_active_mt_degree(active_workers);
415 PSKeepAliveClosure keep_alive(promotion_manager);
416 PSEvacuateFollowersClosure evac_followers(promotion_manager);
417 ReferenceProcessorStats stats;
418 if (reference_processor()->processing_is_mt()) {
419 PSRefProcTaskExecutor task_executor;
420 stats = reference_processor()->process_discovered_references(
421 &_is_alive_closure, &keep_alive, &evac_followers, &task_executor,
422 &_gc_timer);
423 } else {
424 stats = reference_processor()->process_discovered_references(
425 &_is_alive_closure, &keep_alive, &evac_followers, NULL, &_gc_timer);
426 }
427
428 _gc_tracer.report_gc_reference_stats(stats);
429
430 // Enqueue reference objects discovered during scavenge.
431 if (reference_processor()->processing_is_mt()) {
432 PSRefProcTaskExecutor task_executor;
433 reference_processor()->enqueue_discovered_references(&task_executor, &_gc_timer);
434 } else {
435 reference_processor()->enqueue_discovered_references(NULL, &_gc_timer);
436 }
437 }
438
439 {
440 GCTraceTime(Debug, gc, phases) tm("Scrub String Table", &_gc_timer);
441 // Unlink any dead interned Strings and process the remaining live ones.
442 PSScavengeRootsClosure root_closure(promotion_manager);
443 StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure);
444 }
445
446 // Finally, flush the promotion_manager's labs, and deallocate its stacks.
447 promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer);
448 if (promotion_failure_occurred) {
449 clean_up_failed_promotion();
450 log_info(gc, promotion)("Promotion failed");
451 }
452
453 _gc_tracer.report_tenuring_threshold(tenuring_threshold());
454
455 // Let the size policy know we're done. Note that we count promotion
|