<div dir="ltr">JFR has some settings to enable allocation tracking in the Java heap. This isn't enabled by default because it can have some performance impact. I am not sure how it is done without killing performance. Perhaps, we can do something similar for native memory allocations. Also, I suspect that allocations to native memory is much slower than to allocations to Java heap. So, the overhead of tracking native memory allocations should be less than tracking Java allocations.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 6, 2023 at 12:44 AM Thomas Stüfe <<a href="mailto:thomas.stuefe@gmail.com">thomas.stuefe@gmail.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 dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 5, 2023 at 7:04 PM Nathan Reynolds <<a href="mailto:numeralnathan@gmail.com" target="_blank">numeralnathan@gmail.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 dir="ltr"><div>Can we have the native memory allocations push JFR events? This would only happen when enabled. This would make native memory allocation analysis very easy to do in Mission Control.<br></div></div></blockquote><div><br></div><div>Technically, nothing is preventing us from doing so; I'd be worried about the overhead though when doing this for every malloc. mmap is probably less of a problem.</div><div><br></div><div>At the moment, NMT events are send periodically; one could add a threshold-based approach (whenever we reach +1M in any category), but that would give you only sporadic call stacks. <br></div><div> </div></div></div>
</blockquote></div>