RFR: 8275775: Add jcmd VM.classes to print details of all classes [v6]
    Ioi Lam 
    iklam at openjdk.java.net
       
    Fri Mar  4 08:18:03 UTC 2022
    
    
  
On Fri, 4 Mar 2022 07:24:51 GMT, Yi Yang <yyang at openjdk.org> wrote:
>> You should change it to `%4d`. Otherwise, when the numbers are changed in the future (e.g., to 3 or 4 digits) they will be misaligned:
>> 
>> 
>> KlassAddr           Size  State                 Flags    ClassName  
>> 0x0000000800df8400  62    fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800df8400  
>> 0x0000000800df8000  123   fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800df8000  
>> 0x0000000800de4400  4567  fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800de4400
>
>> You should change it to `%4d`. Otherwise, when the numbers are changed in the future (e.g., to 3 or 4 digits) they will be misaligned:
>> 
>> ```
>> KlassAddr           Size  State                 Flags    ClassName  
>> 0x0000000800df8400  62    fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800df8400  
>> 0x0000000800df8000  123   fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800df8000  
>> 0x0000000800de4400  4567  fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800de4400  
>> ```
> 
> This format looks pretty good to me, they are all aligned to left. If you still think it's more proper to have a format like this:
> 
> KlassAddr           Size  State                 Flags    ClassName  
> 0x0000000800df8400  62    fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800df8400  
> 0x0000000800df8000  123   fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800df8000  
> 0x0000000800de4400  4567  fully_initialized     W        java.lang.invoke.LambdaForm$DMH/0x0000000800de4400  
> 
> Then I'm glad to do so ;)
Numbers should be aligned to the right. The following is what I want:
  62
 123
4567
-------------
PR: https://git.openjdk.java.net/jdk/pull/7105
    
    
More information about the hotspot-dev
mailing list