Skip to content

Commit

Permalink
8306768: CodeCache Analytics reports wrong threshold
Browse files Browse the repository at this point in the history
Reviewed-by: phh
Backport-of: 243e643076f70c2cfb480897e1640a21e7ac6552
  • Loading branch information
AntonKozlov authored and Paul Hohensee committed Apr 27, 2023
1 parent aed5d6f commit 42ae833
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/code/codeHeapState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "precompiled.hpp"
#include "code/codeHeapState.hpp"
#include "code/codeBlob.hpp"
#include "compiler/compileBroker.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/sweeper.hpp"
Expand Down Expand Up @@ -1154,10 +1155,9 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
ast->cr();

int reset_val = NMethodSweeper::hotness_counter_reset_val();
double reverse_free_ratio = (res_size > size) ? (double)res_size/(double)(res_size-size) : (double)res_size;
printBox(ast, '-', "Method hotness information at time of this analysis", NULL);
ast->print_cr("Highest possible method temperature: %12d", reset_val);
ast->print_cr("Threshold for method to be considered 'cold': %12.3f", -reset_val + reverse_free_ratio * NmethodSweepActivity);
ast->print_cr("Threshold for method to be considered 'cold': %12.3f", -reset_val + (CodeCache::reverse_free_ratio(heap->code_blob_type()) * NmethodSweepActivity));
if (n_methods > 0) {
avgTemp = hotnessAccumulator/n_methods;
ast->print_cr("min. hotness = %6d", minTemp);
Expand Down

1 comment on commit 42ae833

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.