JDK-8302001 : Add jcmd command to print malloc_stats() info
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2023-02-07
  • Updated: 2023-09-27
  • Resolved: 2023-09-27
Related Reports
Relates :  
Description
We don't have any way to track malloc statistics of a Java process. It will be very helpful to add a jcmd diagnostic command to print the information returned by the malloc_stats().

https://man7.org/linux/man-pages/man3/malloc_stats.3.html
Comments
Since the output of malloc_stats() can not be redirected, I think we can manage with the output printed with malloc_info. I am closing this bug.
27-09-2023

Hi, I'm unassigning myself from this. I believe that not being able to re-direct the output of `malloc_stats()` makes it a bad candidate for being implemented as a diagnostic command. There is a sufficiently good workaround to gain the info in malloc_stats via malloc_info. [~poonam], what do you think? Is malloc_info sufficient?
19-05-2023

For the curious: malloc_info() doesn't provide all of the info that malloc_stats() does, so both complement each other well.
08-03-2023