<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word;line-break:after-white-space"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hi Thomas,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Thanks for the suggestions. Here’s a new webrev:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><a href="http://cr.openjdk.java.net/~tonyp/8223575/webrev.2/">http://cr.openjdk.java.net/~tonyp/8223575/webrev.2/</a></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I renamed the spaces as discussed, added the before capacity to the output, and use the committed size, instead of the reserved size, for capacity. The output now looks like this:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">[31.167s][info][gc,metaspace ] GC(27) Metaspace: 2120K(5504K)->2120K(5504K) NonClass: 1898K(4864K)->1898K(4864K) Class: 221K(640K)->221K(640K)</span></p></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div> <div id="bloop_sign_1559676468291408128" class="bloop_sign"><div>One more minor change: MetaspaceUtils::print_metaspace_change(…) now gets the “after” values using a MetaspaceSizesSnapshot object instead of calling methods directly (which I think is a bit nicer).</div><div><br></div><div>I'd like to add a Twitter copyright to the two new files. But I’m waiting to hear from the “higher ups” about that. I left two TODOs about that in the metaspaceSizesSnapshot.{hpp,cpp} files so I don’t forget. Please ignore those for now… I’ll remove them before pushing.</div><div><br></div><div>Tony</div><div><br></div><div><div>—————</div><div>Tony Printezis | @TonyPrintezis | <a href="mailto:tprintezis@twitter.com">tprintezis@twitter.com</a></div></div><div><br></div></div> <br><p class="airmail_on">On May 15, 2019 at 4:26:17 AM, Thomas Stüfe (<a href="mailto:thomas.stuefe@gmail.com">thomas.stuefe@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>


<title></title>


<div dir="ltr">
<div dir="ltr">Hi Tony,
<div><br></div>
<div>I combine my answer to both your mails up into this one
mail:</div>
<div><br></div>
<div>- I am fine with printing "used" and "committed" and leaving
out "reserved".</div>
<div>- Choose whatever format you like, I like them all :)</div>
<div><br></div>
<div>more inline:</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, May 15, 2019 at 10:15 AM
Tony Printezis <<a href="mailto:tprintezis@twitter.com">tprintezis@twitter.com</a>>
wrote:<br></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;">
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
Thomas,</div>
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<br></div>
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
Yeah, I’ll update the space names as discussed in the previous
e-mail and rework the size transition format (unless I hear
otherwise!).</div>
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<br></div>
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
Re: I generally use references for const arguments and pointers for
arguments the method modifies (to make it a bit clearer what will
be modified and what it will not).</div>
</div>
</blockquote>
<div><br></div>
<div>Yes, I prefer that too.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;">
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<br></div>
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
Quick related question: I saw that some files seem to have SAP (and
also RedHat?) copyright notices in addition to the usual Oracle
ones. So, I can add a Twitter copyright line for any new files we
add?</div>
</div>
</blockquote>
<div><br></div>
<div>I usually add SAP copyrights for files I introduce and which
have a reasonable large original content made by us.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;">
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<br></div>
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
I’m on vacation this week and next, so it might be a few days
before I post a new webrev. Thanks again for the comments!</div>
</div>
</blockquote>
<div><br></div>
<div>Np. Enjoy your time off.</div>
<div><br></div>
<div>Cheers, Thomas</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;">
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<br></div>
<div id="gmail-m_-2896868114653338673bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
Tony</div>
<br>
<div id="gmail-m_-2896868114653338673bloop_sign_1557907893971663104" class="gmail-m_-2896868114653338673bloop_sign">
<div><br></div>
<div>
<div>—————</div>
<div>Tony Printezis | @TonyPrintezis | <a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a></div>
</div>
<div><br></div>
</div>
<br>
<p class="gmail-m_-2896868114653338673airmail_on">On May 13, 2019
at 7:50:44 PM, Thomas Stüfe (<a href="mailto:thomas.stuefe@gmail.com" target="_blank">thomas.stuefe@gmail.com</a>) wrote:</p>
<blockquote type="cite" class="gmail-m_-2896868114653338673clean_bq">
<div>
<div>
<div dir="ltr"><span>Hi Tony,</span>
<div><span><br></span></div>
<div><span>had a look at your second webrev. Seems fine, modulo the
discussion points from my mail from earlier
today. </span></div>
<div><span><br></span></div>
<div><span>Small nit, I personally prefer pointers vs references
for output structures, but I leave it up to you whether you want to
change it.</span></div>
<div><span><br></span></div>
<div><span>Cheers, Thomas</span></div>
</div>
<span><br></span>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr"><span>On Thu, May 9, 2019 at
10:00 PM Tony Printezis <<a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a>>
wrote:<br></span></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>Thomas,</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>Updated webrev:</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><a href="http://cr.openjdk.java.net/~tonyp/8223575/webrev.1/" target="_blank">http://cr.openjdk.java.net/~tonyp/8223575/webrev.1/</a></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>with some of the suggested changes:</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>* did some renaming</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>* created hpp / cpp files for the new class (now called
MetaspaceSizesSnapshot)</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>* moved the formatting macros to
globalDefinitions.hpp</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>Still pending:</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>* What should we call the spaces?</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>* Should we add the before capacity in the
output?</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>(let me know if I missed anything…)</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>Tony</span></div>
<span><br></span>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_sign_1557431846559721984" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_sign">
<div><span><br></span></div>
<div>
<div><span>—————</span></div>
<div><span>Tony Printezis | @TonyPrintezis | <a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a></span></div>
</div>
<div><span><br></span></div>
</div>
<span><br></span>
<p class="gmail-m_-2896868114653338673gmail-m_8541300307760744773airmail_on">
<span>On May 9, 2019 at 12:38:35 PM, Tony Printezis (<a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a>) wrote:</span></p>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq">
<div>
<div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><span>Hi Thomas,</span></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>Thanks for the detailed feedback and suggestions. Please see
inline….</span></div>
<span><br></span>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_sign_1557410557946105088" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773bloop_sign">
<div><span><br></span></div>
<div>
<div><span>—————</span></div>
<div><span>Tony Printezis | @TonyPrintezis | <a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a></span></div>
</div>
<div><span><br></span></div>
</div>
<span><br></span>
<p class="gmail-m_-2896868114653338673gmail-m_8541300307760744773airmail_on">
<span>On May 8, 2019 at 4:07:49 PM, Thomas Stüfe (<a href="mailto:thomas.stuefe@gmail.com" target="_blank">thomas.stuefe@gmail.com</a>) wrote:</span></p>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

Hi Tony,</span></span></div>
<div><span><br></span></div>
<div><span>I think this makes sense. I agree, the output as it is
now can be confusing. Note that users can still be confused since
users may simply not be aware that the default ClassSpace reserved
size is 1G.</span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>Yes. What a user wants to size is (what I call - more below) the
class metadata space. But, in the log, this is hidden in the total
size. So, this creates confusion. FWIW, the older +PrintHeapAtGC
output had the same issue:</p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"> Metaspace  
    used 5660K, capacity 5996K, committed 6144K, reserved
1056768K</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
  class space    used 630K, capacity 734K,
committed 768K, reserved 1048576K</p>
<p>It shows the total size and the class space size (which the user
might not know what it is) but doesn’t explicitly show the space
the user actually wants to size.</p>
<p>I think we can make it a bit easier for them.</p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

Can your change break scripts for folks parsing GC logs? I see that
you only appended content and did not change the existing text, so
I guess this is okay.</span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>Of course the change can break a GC log parsing script, if it
assumes there’s only one size transition on gc,metaspace lines (but
if it just parses the size transition and ignores that rest it will
still work). But is there a hard requirement that we cannot change
any log output? That’d be unfortunate, IMHO. In fact, the
safepoint=info output changed almost totally between 11 and
now.</p>
<p>11:</p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">[49.768s][info
][safepoint        ] Entering safepoint region:
Cleanup</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">...</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
[49.769s][info ][safepoint        ] Total time
for which application threads were stopped: 0.0005466 seconds,
Stopping threads took: 0.0001931 seconds</p>
<div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div>
<p>now:</p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">[880.754s][info
][safepoint        ] Safepoint
"GenCollectForAllocation", Time since last: 990253904 ns, Reaching
safepoint: 440316 ns, At safepoint: 3761268 ns, Total: 4201584
ns</span></p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

---</span></div>
<div><span><br></span></div>
<div>
<div><span>Format and naming: Different forms are used in different
places. In hs-err files, we print "Metaspace" and "Class Space",
with the former being the total sum and the latter the class space
part.</span></div>
<div><span><br></span></div>
<div><span>But in other corners, eg. in the jcmd VM.metaspace
command, we print non-class space and class space and maybe the sum
in addition. Usually non-class space is called
"Non-Class".</span></div>
<div><span><br></span></div>
<div><span>I personally would prefer, in this case, the latter
names: "Class Space" and "Non-Class Space"</span></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>Here’s another pet-peeve of mine (and I’m probably overthinking
this) :-) : Users know that the metaspace holds class metadata. So,
calling the area that actually holds the class metadata “Non-Class
Space” and the area that holds some internal JVM data structure
“Class Space” is counter-productive and confusing (IMHO). We don’t
have to use the names I used. But any chance of coming up with
something less confusing?</p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div>
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

---<br></span></div>
</div>
<div><span><br></span></div>
<div><span>Note that for non-class space, reserved size can
actually change when allocating and releasing metaspace, if
VirtualSpaceNodes get purged or newly allocated. Hence total
reserved size can change too. So we may want to print out reserved
before and reserved after sizes. I guess that was also missing from
the output before.</span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>I’ll be very happy to add the before capacity to the output. You
mean something like this, right?</p>
<p>2300K(4192K)->2100K(4192K)</p>
<p>And we should also add it to the heap size transitions too, as
they have the same issue (the heap can be resized during a GC). Of
course, this will definitely require GC log parser changes. :-) But
I think the change is worthwhile. Any objections?</p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

----</span></div>
<div><span><br></span></div>
<div><span>Since used = class used + nonclass used, I would
simplify PreMetaspaceValues to _non_class_used and _class_used and
calculate the sum on the fly.</span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>Yeah, I thought about that. I just decided to just store the
total used to avoid replicating the logic of how that’s calculated
in that class too.</p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

---</span></div>
<div><span><br></span></div>
<div><span>You added a new dependency to heap.hpp into
metaspace.cpp for the format string. Is this really necessary? Can
you move this define to metaspace.cpp?</span></div>
<div><span><br></span></div>
<div><span>If not, you need at least add include heap.hpp (did it
build this way without precompiled headers?)</span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>I didn’t try to explicitly compile without precompiled headers.
jdk submit job was successful. Is that usually evidence enough? If
not, I’ll need to add the extra step to my workflow.</p>
<p>As I eluded to earlier, if this change is accepted I’m going to
suggest to also expand the gc,heap output with sub-space
information for the young gen (eden  / survivors). So I wanted
to move the FORMAT macros to somewhere that can also be shared by
GC files. I was not sure if heap.hpp was the best place for them.
Maybe I can just put them in globalDefinitions.hpp, as there’s
already some size formatting utilities there
(proper_unit_for_byte_size(…), etc.)?</p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

----</span></div>
<div><span><br></span></div>
<div><span>The following issues are matters of taste, and I leave
it up to you whether you want to change something:</span></div>
<div><span><br></span></div>
<div>
<div><span>-> I wince a bit at yet another
metaspace-sizes-structure - we have already
ClassLoaderMetaspaceStatistics and MetaspaceCounters, and maybe
others. JFR may also do something similar. Would it be possible to
reuse one of those? (I guess ClassLoaderMetaspaceStatistics is too
fine granular and too expensive to collect.)</span></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>I was not aware of the two you mentioned. Aren’t
MetaspaceCounters only available when UsePerfData is enabled? I’d
rather decouple this from UsePerfData.
ClassLoaderMetaspaceStatistics does seem too fine-grain for what I
want. And I modeled PreMetaspaceValues on PreGCValues used in
ParallelGC, as it’s a nice way to package up what’s needed in an
object and easily re-use it in the few places where it’s needed.
The way is done now, i.e., just store the metaspace used size and
pass it to the print method, is a bit ad-hoc (IMHO).</p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

-> I would prefer the class PreMetaspaceValues to live inside an
own header in metaspace folder, and in the metaspace namespace like
we did for similar helpers.</span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>I can definitely do that.</p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

-> I would take the "Pre" out of the name and the member names
and just name it "Snapshot" and the members "used" and "class
used".</span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>Again, I modeled it based on ParallelGC's PreGCValues class. But
I can rename it to Snapshot to generalize its use.</p>
<p><br></p>
<div>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

-> I would probably have made PreMetaspaceValues a dumb
structure and added a function "MetaspaceAux::get_dimensions()"
instead of adding the implementation to the constructor and to the
header file. At least I would prefer the ctor implementation to the
cpp file.</span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p><br></p>
<p>I can move it to a cpp file. This will also eliminate a cyclic
dependency I had to address by the class forward declaration.</p>
<p><br></p>
<p>Tony</p>
<p><br></p>
<div>
<blockquote type="cite" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773clean_bq" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>
<div>
<div dir="ltr">
<div dir="ltr">
<div><span><br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">

<br></span></div>
<div><span>Cheers, Thomas</span></div>
</div>
</div>
<span><br></span>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr"><span>On Wed, May 8, 2019 at 4:20
PM Tony Printezis <<a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a>>
wrote:<br></span></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>Any chance of someone taking a look at this?</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><a href="http://cr.openjdk.java.net/~tonyp/8223575/webrev.0/" target="_blank">http://cr.openjdk.java.net/~tonyp/8223575/webrev.0/</a></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span>As I said on the JIRA, users can be confused when they
metaspace capacity shows as over 1G even though they asked for
128M. Breaking down the spaces, when coops are enabled, can address
this confusion (and having the actual occupancy of each space
separately is also a lot more informative and avoids guesswork).
The output looks like this when coops are enabled:</span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<span><br></span></div>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span><span style="font-variant-ligatures:no-common-ligatures">[10.090s][info][gc,metaspace
    ] GC(8) Metaspace: 2130K->2130K(1056768K)
ClassMetadata: 1906K->1906K(8192K) ClassSpace:
223K->223K(1048576K)</span></span></p>
</div>
<div><br></div>
and like this (i.e., what it was before the change) when coops are
not enabled:
<div><br></div>
<div>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">[25.767s][info][gc,metaspace
    ] GC(28) Metaspace:
8107K->8107K(10240K)</span></p>
</div>
<div><br></div>
<div>A couple of notes on the changes:</div>
<div><br></div>
<div>- I’m open to different suggestions for what to call
ClassMetadata and ClassSpace. :-)</div>
<div>- I didn’t know where to put the HEAP_CHANGE_FORMAT and
HEAP_CHANGE_FORMAT_ARGS macros, so that they can be easily shared,
and I ended up putting them in heap.hpp. Let me know if there’s a
better place for them.</div>
<div><br></div>
<div>Tony</div>
<div><br>
<div id="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_sign_1557324722471365888" class="gmail-m_-2896868114653338673gmail-m_8541300307760744773gmail-m_2409837340603532282bloop_sign">
<div><br></div>
<div>
<div>—————</div>
<div>Tony Printezis | @TonyPrintezis |<span class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-converted-space"> </span><a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a></div>
</div>
<div><br></div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
<br class="gmail-m_-2896868114653338673gmail-m_8541300307760744773Apple-interchange-newline">
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>


</div></div></span></blockquote></body></html>