Skip to content

Conversation

@omniCoder77
Copy link
Contributor

JIRA Ticket

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 pass
image

jmap before patch
image

jmap after patch
image

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.

@omniCoder77 omniCoder77 marked this pull request as draft January 8, 2026 14:23
@omniCoder77 omniCoder77 marked this pull request as ready for review January 8, 2026 14:23
@omniCoder77
Copy link
Contributor Author

@netudima @smiklosovic Requesting your reviews when convenient, this PR implements the JMX ObjectName deduplication suggested in CASSANDRA-20446.

@omniCoder77 omniCoder77 closed this Jan 8, 2026
@omniCoder77 omniCoder77 deleted the improvement/CASSANDRA-20446 branch January 8, 2026 14:43
@omniCoder77 omniCoder77 restored the improvement/CASSANDRA-20446 branch January 8, 2026 14:43
@omniCoder77 omniCoder77 reopened this Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant