Skip to content
Permalink
Browse files
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 39f0b27a127e65985df0899ff881dc99f313dd16
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
@@ -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++;
@@ -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
@@ -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 */

1 comment on commit 39f0b27

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 39f0b27 Apr 1, 2021

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.