Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp @ 4095:bca17e38de00
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
Summary: Select number of GC threads dynamically based on heap usage and number of Java threads
Reviewed-by: johnc, ysr, jcoomes
author | jmasa |
---|---|
date | Tue, 09 Aug 2011 10:16:01 -0700 |
parents | f95d63e2154a |
children | d2a62e0f25eb |
comparison
equal
deleted
inserted
replaced
4094:3a298e04d914 | 4095:bca17e38de00 |
---|---|
185 // gathered. The policy may use these counters as a threshhold | 185 // gathered. The policy may use these counters as a threshhold |
186 // for reliable data. | 186 // for reliable data. |
187 julong _young_gen_change_for_minor_throughput; | 187 julong _young_gen_change_for_minor_throughput; |
188 julong _old_gen_change_for_major_throughput; | 188 julong _old_gen_change_for_major_throughput; |
189 | 189 |
190 static const uint GCWorkersPerJavaThread = 2; | |
191 | |
190 // Accessors | 192 // Accessors |
191 | 193 |
192 double gc_pause_goal_sec() const { return _gc_pause_goal_sec; } | 194 double gc_pause_goal_sec() const { return _gc_pause_goal_sec; } |
193 // The value returned is unitless: it's the proportion of time | 195 // The value returned is unitless: it's the proportion of time |
194 // spent in a particular collection type. | 196 // spent in a particular collection type. |
329 _decrement_tenuring_threshold_for_survivor_limit = v; | 331 _decrement_tenuring_threshold_for_survivor_limit = v; |
330 } | 332 } |
331 // Return true if the policy suggested a change. | 333 // Return true if the policy suggested a change. |
332 bool tenuring_threshold_change() const; | 334 bool tenuring_threshold_change() const; |
333 | 335 |
336 static bool _debug_perturbation; | |
337 | |
334 public: | 338 public: |
335 AdaptiveSizePolicy(size_t init_eden_size, | 339 AdaptiveSizePolicy(size_t init_eden_size, |
336 size_t init_promo_size, | 340 size_t init_promo_size, |
337 size_t init_survivor_size, | 341 size_t init_survivor_size, |
338 double gc_pause_goal_sec, | 342 double gc_pause_goal_sec, |
339 uint gc_cost_ratio); | 343 uint gc_cost_ratio); |
344 | |
345 // Return number default GC threads to use in the next GC. | |
346 static int calc_default_active_workers(uintx total_workers, | |
347 const uintx min_workers, | |
348 uintx active_workers, | |
349 uintx application_workers); | |
350 | |
351 // Return number of GC threads to use in the next GC. | |
352 // This is called sparingly so as not to change the | |
353 // number of GC workers gratuitously. | |
354 // For ParNew collections | |
355 // For PS scavenge and ParOld collections | |
356 // For G1 evacuation pauses (subject to update) | |
357 // Other collection phases inherit the number of | |
358 // GC workers from the calls above. For example, | |
359 // a CMS parallel remark uses the same number of GC | |
360 // workers as the most recent ParNew collection. | |
361 static int calc_active_workers(uintx total_workers, | |
362 uintx active_workers, | |
363 uintx application_workers); | |
364 | |
365 // Return number of GC threads to use in the next concurrent GC phase. | |
366 static int calc_active_conc_workers(uintx total_workers, | |
367 uintx active_workers, | |
368 uintx application_workers); | |
340 | 369 |
341 bool is_gc_cms_adaptive_size_policy() { | 370 bool is_gc_cms_adaptive_size_policy() { |
342 return kind() == _gc_cms_adaptive_size_policy; | 371 return kind() == _gc_cms_adaptive_size_policy; |
343 } | 372 } |
344 bool is_gc_ps_adaptive_size_policy() { | 373 bool is_gc_ps_adaptive_size_policy() { |