mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-16 00:54:38 +02:00
6423256: GC stacks should use a better data structure
6942771: SEGV in ParScanThreadState::take_from_overflow_stack Reviewed-by: apetrusenko, ysr, pbk
This commit is contained in:
parent
aff36499e7
commit
1cdd538ea5
30 changed files with 718 additions and 402 deletions
|
@ -46,23 +46,6 @@ ParCompactionManager::ParCompactionManager() :
|
|||
marking_stack()->initialize();
|
||||
_objarray_stack.initialize();
|
||||
region_stack()->initialize();
|
||||
|
||||
// Note that _revisit_klass_stack is allocated out of the
|
||||
// C heap (as opposed to out of ResourceArena).
|
||||
int size =
|
||||
(SystemDictionary::number_of_classes() * 2) * 2 / ParallelGCThreads;
|
||||
_revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true);
|
||||
// From some experiments (#klass/k)^2 for k = 10 seems a better fit, but this will
|
||||
// have to do for now until we are able to investigate a more optimal setting.
|
||||
_revisit_mdo_stack = new (ResourceObj::C_HEAP) GrowableArray<DataLayout*>(size*2, true);
|
||||
}
|
||||
|
||||
ParCompactionManager::~ParCompactionManager() {
|
||||
delete _revisit_klass_stack;
|
||||
delete _revisit_mdo_stack;
|
||||
// _manager_array and _stack_array are statics
|
||||
// shared with all instances of ParCompactionManager
|
||||
// should not be deallocated.
|
||||
}
|
||||
|
||||
void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
|
||||
|
@ -134,9 +117,9 @@ ParCompactionManager::gc_thread_compaction_manager(int index) {
|
|||
}
|
||||
|
||||
void ParCompactionManager::reset() {
|
||||
for(uint i=0; i<ParallelGCThreads+1; i++) {
|
||||
manager_array(i)->revisit_klass_stack()->clear();
|
||||
manager_array(i)->revisit_mdo_stack()->clear();
|
||||
for(uint i = 0; i < ParallelGCThreads + 1; i++) {
|
||||
assert(manager_array(i)->revisit_klass_stack()->is_empty(), "sanity");
|
||||
assert(manager_array(i)->revisit_mdo_stack()->is_empty(), "sanity");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,10 +161,3 @@ void ParCompactionManager::drain_region_stacks() {
|
|||
}
|
||||
} while (!region_stack()->is_empty());
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
bool ParCompactionManager::stacks_have_been_allocated() {
|
||||
return (revisit_klass_stack()->data_addr() != NULL &&
|
||||
revisit_mdo_stack()->data_addr() != NULL);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue