comparison src/share/vm/runtime/vm_version.cpp @ 24178:ab892d05b029

8161993: G1 crashes if active_processor_count changes during startup Summary: Use the initial active processor count for memory initialization instead of the current active one. Reviewed-by: dholmes, mgerdin
author tschatzl
date Thu, 15 Dec 2016 20:00:01 -0500
parents ddce0b7cee93
children 719853999215
comparison
equal deleted inserted replaced
24177:ca765f57fe3c 24178:ab892d05b029
1 /* 1 /*
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1998, 2016, 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.
294 // for large numbers of worker threads. Instead of 294 // for large numbers of worker threads. Instead of
295 // hogging the whole system, use a fraction of the workers for every 295 // hogging the whole system, use a fraction of the workers for every
296 // processor after the first 8. For example, on a 72 cpu machine 296 // processor after the first 8. For example, on a 72 cpu machine
297 // and a chosen fraction of 5/8 297 // and a chosen fraction of 5/8
298 // use 8 + (72 - 8) * (5/8) == 48 worker threads. 298 // use 8 + (72 - 8) * (5/8) == 48 worker threads.
299 unsigned int ncpus = (unsigned int) os::active_processor_count(); 299 unsigned int ncpus = (unsigned int) os::initial_active_processor_count();
300 return (ncpus <= switch_pt) ? 300 return (ncpus <= switch_pt) ?
301 ncpus : 301 ncpus :
302 (switch_pt + ((ncpus - switch_pt) * num) / den); 302 (switch_pt + ((ncpus - switch_pt) * num) / den);
303 } else { 303 } else {
304 return ParallelGCThreads; 304 return ParallelGCThreads;