Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8176026: SA: Huge heap sizes cause a negative value to be displayed i…
…n the jhisto heap total

Reviewed-by: cjplummer, kevinw, ysuenaga
  • Loading branch information
jyukutyo authored and YaSuenag committed Apr 1, 2021
1 parent de495df commit 39f0b27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -65,8 +65,8 @@ public void printOn(PrintStream tty) {
ObjectHistogramElement.titleOn(tty);
Iterator<ObjectHistogramElement> iterator = list.listIterator();
int num=0;
int totalCount=0;
int totalSize=0;
long totalCount=0;
long totalSize=0;
while (iterator.hasNext()) {
ObjectHistogramElement el = iterator.next();
num++;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -47,7 +47,7 @@ public void updateWith(Oop obj) {
}

public int compare(ObjectHistogramElement other) {
return (int) (other.size - size);
return Long.compare(other.size, size);
}

/** Klass for this ObjectHistogramElement */
Expand Down

1 comment on commit 39f0b27

@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.