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
  • Loading branch information
AntonKozlov authored and Paul Hohensee committed Apr 26, 2023
1 parent e132605 commit 243e643
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 @@ -1152,10 +1153,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() * NmethodSweepActivity));
if (n_methods > 0) {
avgTemp = hotnessAccumulator/n_methods;
ast->print_cr("min. hotness = %6d", minTemp);
Expand Down

3 comments on commit 243e643

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@AntonKozlov
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 243e643 Apr 26, 2023

Choose a reason for hiding this comment

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

@AntonKozlov the backport was successfully created on the branch AntonKozlov-backport-243e6430 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 243e6430 from the openjdk/jdk17u-dev repository.

The commit being backported was authored by Anton Kozlov on 26 Apr 2023 and was reviewed by Paul Hohensee.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev.git AntonKozlov-backport-243e6430:AntonKozlov-backport-243e6430
$ git checkout AntonKozlov-backport-243e6430
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev.git AntonKozlov-backport-243e6430

Please sign in to comment.