< prev index next >

src/hotspot/share/gc/cms/parNewGeneration.cpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2018, 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  *


 609                            &cld_scan_closure,
 610                            &_par_state_string);
 611 
 612   par_scan_state.end_strong_roots();
 613 
 614   // "evacuate followers".
 615   par_scan_state.evacuate_followers_closure().do_void();
 616 
 617   // This will collapse this worker's promoted object list that's
 618   // created during the main ParNew parallel phase of ParNew. This has
 619   // to be called after all workers have finished promoting objects
 620   // and scanning promoted objects. It should be safe calling it from
 621   // here, given that we can only reach here after all thread have
 622   // offered termination, i.e., after there is no more work to be
 623   // done. It will also disable promotion tracking for the rest of
 624   // this GC as it's not necessary to be on during reference processing.
 625   _old_gen->par_oop_since_save_marks_iterate_done((int) worker_id);
 626 }
 627 
 628 ParNewGeneration::ParNewGeneration(ReservedSpace rs, size_t initial_byte_size)
 629   : DefNewGeneration(rs, initial_byte_size, "PCopy"),
 630   _plab_stats("Young", YoungPLABSize, PLABWeight),
 631   _overflow_list(NULL),
 632   _is_alive_closure(this)
 633 {
 634   NOT_PRODUCT(_overflow_counter = ParGCWorkQueueOverflowInterval;)
 635   NOT_PRODUCT(_num_par_pushes = 0;)
 636   _task_queues = new ObjToScanQueueSet(ParallelGCThreads);
 637   guarantee(_task_queues != NULL, "task_queues allocation failure.");
 638 
 639   for (uint i = 0; i < ParallelGCThreads; i++) {
 640     ObjToScanQueue *q = new ObjToScanQueue();
 641     guarantee(q != NULL, "work_queue Allocation failure.");
 642     _task_queues->register_queue(i, q);
 643   }
 644 
 645   for (uint i = 0; i < ParallelGCThreads; i++) {
 646     _task_queues->queue(i)->initialize();
 647   }
 648 
 649   _overflow_stacks = NULL;


   1 /*
   2  * Copyright (c) 2001, 2019, 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  *


 609                            &cld_scan_closure,
 610                            &_par_state_string);
 611 
 612   par_scan_state.end_strong_roots();
 613 
 614   // "evacuate followers".
 615   par_scan_state.evacuate_followers_closure().do_void();
 616 
 617   // This will collapse this worker's promoted object list that's
 618   // created during the main ParNew parallel phase of ParNew. This has
 619   // to be called after all workers have finished promoting objects
 620   // and scanning promoted objects. It should be safe calling it from
 621   // here, given that we can only reach here after all thread have
 622   // offered termination, i.e., after there is no more work to be
 623   // done. It will also disable promotion tracking for the rest of
 624   // this GC as it's not necessary to be on during reference processing.
 625   _old_gen->par_oop_since_save_marks_iterate_done((int) worker_id);
 626 }
 627 
 628 ParNewGeneration::ParNewGeneration(ReservedSpace rs, size_t initial_byte_size)
 629   : DefNewGeneration(rs, initial_byte_size, "CMS young collection pauses"),
 630   _plab_stats("Young", YoungPLABSize, PLABWeight),
 631   _overflow_list(NULL),
 632   _is_alive_closure(this)
 633 {
 634   NOT_PRODUCT(_overflow_counter = ParGCWorkQueueOverflowInterval;)
 635   NOT_PRODUCT(_num_par_pushes = 0;)
 636   _task_queues = new ObjToScanQueueSet(ParallelGCThreads);
 637   guarantee(_task_queues != NULL, "task_queues allocation failure.");
 638 
 639   for (uint i = 0; i < ParallelGCThreads; i++) {
 640     ObjToScanQueue *q = new ObjToScanQueue();
 641     guarantee(q != NULL, "work_queue Allocation failure.");
 642     _task_queues->register_queue(i, q);
 643   }
 644 
 645   for (uint i = 0; i < ParallelGCThreads; i++) {
 646     _task_queues->queue(i)->initialize();
 647   }
 648 
 649   _overflow_stacks = NULL;


< prev index next >