119 MAX2((uintx) GCWorkersPerJavaThread * application_workers, |
119 MAX2((uintx) GCWorkersPerJavaThread * application_workers, |
120 min_workers); |
120 min_workers); |
121 |
121 |
122 // Choose a number of GC threads based on the current size |
122 // Choose a number of GC threads based on the current size |
123 // of the heap. This may be complicated because the size of |
123 // of the heap. This may be complicated because the size of |
124 // the heap depends on factors such as the thoughput goal. |
124 // the heap depends on factors such as the throughput goal. |
125 // Still a large heap should be collected by more GC threads. |
125 // Still a large heap should be collected by more GC threads. |
126 active_workers_by_heap_size = |
126 active_workers_by_heap_size = |
127 MAX2((size_t) 2U, Universe::heap()->capacity() / HeapSizePerGCThread); |
127 MAX2((size_t) 2U, Universe::heap()->capacity() / HeapSizePerGCThread); |
128 |
128 |
129 uintx max_active_workers = |
129 uintx max_active_workers = |
443 // young gen or the average of the live in the young gen. |
443 // young gen or the average of the live in the young gen. |
444 // If the current value drops quickly, that should be taken |
444 // If the current value drops quickly, that should be taken |
445 // into account (i.e., don't trigger if the amount of free |
445 // into account (i.e., don't trigger if the amount of free |
446 // space has suddenly jumped up). If the current is much |
446 // space has suddenly jumped up). If the current is much |
447 // higher than the average, use the average since it represents |
447 // higher than the average, use the average since it represents |
448 // the longer term behavor. |
448 // the longer term behavior. |
449 const size_t live_in_eden = |
449 const size_t live_in_eden = |
450 MIN2(eden_live, (size_t) avg_eden_live()->average()); |
450 MIN2(eden_live, (size_t) avg_eden_live()->average()); |
451 const size_t free_in_eden = max_eden_size > live_in_eden ? |
451 const size_t free_in_eden = max_eden_size > live_in_eden ? |
452 max_eden_size - live_in_eden : 0; |
452 max_eden_size - live_in_eden : 0; |
453 const size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average()); |
453 const size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average()); |