<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Leo<div class=""><br class=""></div><div class="">1. <a href="http://cr.openjdk.java.net/~lkorinth/8217389/00/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java.udiff.html" class="">http://cr.openjdk.java.net/~lkorinth/8217389/00/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java.udiff.html</a></div><div class=""><br class=""></div><div class="">I am not sure how your changes make code clear. Also '<span style="color: blue; font-weight: bold; orphans: 2; widows: 2;" class="">128*M' </span><span style="orphans: 2; widows: 2;" class="">should have spaces.</span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Jan 18, 2019, at 9:23 AM, Leo Korinth <<a href="mailto:leo.korinth@oracle.com" class="">leo.korinth@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">Here I am removing warnings for unused variables.<br class=""><br class="">Some variables can not be removed as in the case of creating a new primitive array without assigning it to a variable. It is not allowed, in those cases I use @SuppressWarnings("unused").<br class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">I think that it would be better to really use these variables somehow.</div><div class=""><br class=""></div><div class="">The hotspot compilers might also optimize such arrays initialization since results are not used.  The tests like this</div><div class=""><a href="http://cr.openjdk.java.net/~lkorinth/8217389/00/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java" class="">http://cr.openjdk.java.net/~lkorinth/8217389/00/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java</a></div><div class="">just silently pass without any memory allocation and actual testing.</div><div class=""><br class=""></div><div class="">I think it would be better to change this variables to be public static and/or be used by some external stuff (print zero/last element as example). It guarantee that compiler can't remove this allocation as a dead code. </div><div class=""><br class=""></div><div class="">See following test as example:</div><div class=""><a href="http://hg.openjdk.java.net/jdk/jdk/file/cb7347310fa1/test/hotspot/jtreg/gc/TestMemoryInitialization.java" class="">http://hg.openjdk.java.net/jdk/jdk/file/cb7347310fa1/test/hotspot/jtreg/gc/TestMemoryInitialization.java</a></div><div class=""><br class=""></div><div class="">Might be some library helper which produce some amount off garbage is useful. </div><div class="">There are already a lot of methods to produce garbage here but they seems to be overcomplicated. Not sure it make sense to reuse them.</div><div class=""><a href="http://hg.openjdk.java.net/jdk/jdk/file/cb7347310fa1/test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp" class="">http://hg.openjdk.java.net/jdk/jdk/file/cb7347310fa1/test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Leonid</div><div class=""><br class=""></div><div class=""></div><blockquote type="cite" class=""><div class=""><div class="">In some cases the variable is not used at all, and I remove it, but still add the variable name as a comment after the expression, as the variable name might have helped as documentation. I also just commented out "final int CONSTANT_Unicode = 2;" if that information might be useful in the future, it is a constant that we do not expect in the test case.<br class=""><br class="">Otherwise I just try to remove the code.<br class=""><br class="">This fix is somewhat based/dependent on the rest of my "JTREG:" webrevs.<br class=""><br class="">Enhancement:<br class=""><a href="https://bugs.openjdk.java.net/browse/JDK-8217389" class="">https://bugs.openjdk.java.net/browse/JDK-8217389</a><br class=""><br class="">Webrev:<br class="">http://cr.openjdk.java.net/~lkorinth/8217389/00<br class=""><br class="">Testing:<br class="">passed locally: open/test/hotspot/jtreg/:hotspot_gc<br class=""><br class="">Thanks,<br class="">Leo<br class=""></div></div></blockquote></div><br class=""></div></body></html>