omniCoder77 opened a new pull request, #4548:
URL: https://github.com/apache/cassandra/pull/4548

   
   [JIRA Ticket](https://issues.apache.org/jira/browse/CASSANDRA-20446)
   
   **Issue:**
   For MBean creation, cassandra uses `javax.management.ObjectName(String 
name)` constructor. Due to this, string has to be parsed to extract properties.
   
   **My Proposed Solution:**
   Use `javax.management.ObjectName(String name, Hashtable<String, String> 
table)` constructor. Using this we skip parsing. 
   
   **Validation**
   All the 
[`CassandraMetricsRegistryTest.java`](https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/metrics/CassandraMetricsRegistryTest.java)
 pass
   <img width="1884" height="360" alt="image" 
src="https://github.com/user-attachments/assets/2d92202e-fb60-462e-bc51-007f1031b386";
 />
   
   jmap before patch
   <img width="1022" height="243" alt="image" 
src="https://github.com/user-attachments/assets/49ccea53-68e2-466d-b9ef-8a1d263b52ff";
 />
   
   jmap after patch
   <img width="918" height="166" alt="image" 
src="https://github.com/user-attachments/assets/de87fb80-e25b-4b38-aed6-edbc0aa86c97";
 />
   
   **Before patch**
   1. ObjectName$Property: 56,206 instances (~1.35 MB)
   2. ObjectName$Property[]: 29,383 instances (~0.93 MB)
   3. String: 107,906 instances
   
   **After patch**
   1. ObjectName$Property: 18,763 instances (~0.45 MB)
   2. ObjectName$Property[]: 19,023 instances (~0.46 MB)
   3. String: 96,639 instances
   4. ObjectName: 9,512 instances (~0.30 MB)
   
   This represents ~66% reduction in `ObjectName$Property` instances and a 
decrease in overall JMX's heap usage, and no changes to the externally visible 
JMX names or behavior.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to