<div id="mailbox-conversation" style="color:#494F50;font-size:14.000000px;font-family:'Helvetica Neue'"><div>Hi Erik</div><div><br></div><div>Thank you for your reply.<br></div><div><br></div><div>The query language designed in `jfr view` is<span style="caret-color: rgb(73, 79, 80); color: rgb(73, 79, 80); font-family: "Helvetica Neue"; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none; display: inline !important; float: none;"> an excellent idea.</span> You can query JFR file as a database.</div><div><br></div><div>I saw that the weight of jdk.ObjectAllocationSample is obtained by comparing the difference in thread->allocated_bytes() between the two events. It is not the size of the actual object or the size of the TLAB.</div><div><br></div><div>For allocation-by-thread, if the Allocated field is added, the result is almost the same as thread-allocation. (However, because thread-allocation already exists, it is no longer necessary to add the Allocated field to allocation-by-thread.)</div><div><br></div><div>For allocation-by-class and allocation-by-site, if the Allocated field is added, the Allocated sum of all Classes or all Sites should be close to the actual sum, and there will be no obvious difference due to the sample mechanism. </div><div>From this point, adding 'Allocated' is feasible.</div><div><br></div><div>However, we also know that for the weight in each event, its value is the difference between two thread->allocated_bytes(). The added 'Allocated' field cannot accurately represent the actual memory allocated by Site or Class. </div><div>It can only be said from from a statistical perspective, there is a large correlation.</div><div><br></div><div>If what you concerned is the 'Allocated' field cannot accurately represent the amount of memory requested by the actual Site or Class, I agree.</div><div><span style="caret-color: rgb(73, 79, 80); color: rgb(73, 79, 80); font-family: "Helvetica Neue"; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none; display: inline !important; float: none;">If what you concerned is</span> the difference between the total number of 'Allocated' and the actual amount of memory allocated, I feel that adding this field should be no problem.</div><div><br></div><div><div><span style="caret-color: #494f50;color: #494f50;font-family: tahoma;font-size: 14.0px;font-style: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: auto;text-align: start;text-indent: 0.0px;text-transform: none;white-space: normal;widows: auto;word-spacing: 0.0px;-webkit-text-stroke-width: 0.0px;background-color: #ffffff;text-decoration: none;display: inline;float: none;">Best Regards</span></div></div><div><br class="ignorable"></div><blockquote><div><div style="font-size: 70%"> ------------------Original Mail ------------------</div><div><b>Sender:</b>Erik Gahlin <erik.gahlin@oracle.com></div><div><b>Send Date:</b>Wed Mar 20 17:56:23 2024</div><div><b>Recipients:</b>Long Yang <yibo.yl@alibaba-inc.com>, hotspot-jfr-dev@openjdk.org <hotspot-jfr-dev@openjdk.org></div><div><b>Subject:</b>Re: jfr view: Regarding adding "Allocated" column to the allocation related 3 views</div></div><div><blockquote class="gmail_quote"><meta><style type="text/css">P {margin-top: 0;margin-bottom: 0;}</style><div class="elementToProof" style="font-family: aptos , aptos_embeddedfont , aptos_msfontservice , calibri , helvetica , sans-serif;font-size: 12.0pt;color: #000000;">Hi,</div><div class="elementToProof" style="font-family: aptos , aptos_embeddedfont , aptos_msfontservice , calibri , helvetica , sans-serif;font-size: 12.0pt;color: #000000;"><br></div><div class="elementToProof" style="font-family: aptos , aptos_embeddedfont , aptos_msfontservice , calibri , helvetica , sans-serif;font-size: 12.0pt;color: #000000;">The value is sample-based and only a rough estimate. That's why only a percentage is shown. The purpose is to find the worst offenders. Thread allocation is more precise as it looks at a byte value stored in the thread.</div><div class="elementToProof" style="font-family: aptos , aptos_embeddedfont , aptos_msfontservice , calibri , helvetica , sans-serif;font-size: 12.0pt;color: #000000;"><br></div><div class="elementToProof" style="font-family: aptos , aptos_embeddedfont , aptos_msfontservice , calibri , helvetica , sans-serif;font-size: 12.0pt;color: #000000;">(I might come off as negative to your suggestions, but when I implemented 'jfr view' I tried many different views and layouts, only the best made it. The main reason I created the query language was so I could quickly try things out.)</div><div class="elementToProof" style="font-family: aptos , aptos_embeddedfont , aptos_msfontservice , calibri , helvetica , sans-serif;font-size: 12.0pt;color: #000000;"><br></div><div class="elementToProof" style="font-family: aptos , aptos_embeddedfont , aptos_msfontservice , calibri , helvetica , sans-serif;font-size: 12.0pt;color: #000000;">Erik</div><hr style="display: inline-block;width: 98.0%;"><div id="divRplyFwdMsg"><span style="font-family: calibri , sans-serif;font-size: 11.0pt;color: #000000;"><b>From:</b> hotspot-jfr-dev <hotspot-jfr-dev-retn@openjdk.org> on behalf of Long Yang <yibo.yl@alibaba-inc.com><br><b>Sent:</b> Wednesday, March 20, 2024 3:46 AM<br><b>To:</b> hotspot-jfr-dev@openjdk.org <hotspot-jfr-dev@openjdk.org><br><b>Subject:</b> jfr view: Regarding adding "Allocated" column to the allocation related 3 views</span><div> </div></div><div style="color: #494f50;font-size: 14.0px;font-family: helvetica neue;" id="x_mailbox-conversation"><div>hi all</div><div><br></div><div><b>jfr view</b> has three predefined views regarding allocation: <b>allocation-by-thread</b>,<b>allocation-by-class</b>,<b> allocation-by-site</b>.</div><div>Currently, these three views only show percentages. </div><div>Usually, we will first look at the absolute value of memory application (total number of allocated bytes). </div><div>When the absolute value is larger enough, the items with larger proportions are more meaningful.</div><div>I don’t know if I can add <b>Allocated</b> column to these three views, similar to the<b>thread-allocation</b> view.</div><div><br></div><div> Allocation by Class</div><div>Object Type Allocated Allocation Pressure</div><div>--------------------------------------------- ---------------- -------------------</div><div>byte[] 11.7 GB 99.82%</div><div><br></div><div style="font-family: tahoma;font-size: 14.0px;color: #494f50;"><span style="background-color: #ffffff;">Best Regards</span></div></div></blockquote></div></blockquote></div>