Skip to content

ICU-23371 Reduce the memory footprint subdivisionData in ValidIdentifiers#3938

Open
gvictor wants to merge 1 commit intounicode-org:mainfrom
gvictor:ICU-23366
Open

ICU-23371 Reduce the memory footprint subdivisionData in ValidIdentifiers#3938
gvictor wants to merge 1 commit intounicode-org:mainfrom
gvictor:ICU-23366

Conversation

@gvictor
Copy link
Copy Markdown
Collaborator

@gvictor gvictor commented Apr 13, 2026

HashSet internally uses HashMap requests extra memory footprints for each entry. Use Set.copyOf(Set) to avoid the memory overhead The heap dump shows ~351kB reduction.

Also, use Map.copyOf(map) instead of HashMap. It reduces the memory footprint by ~52kB.

Checklist

  • Required: Issue filed: ICU-23366
  • Required: The PR title must be prefixed with a JIRA Issue number. Example: "ICU-NNNNN Fix xyz"
  • Required: Each commit message must be prefixed with a JIRA Issue number. Example: "ICU-NNNNN Fix xyz"
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable
  • Approver: Feel free to merge on my behalf

@gvictor gvictor requested review from markusicu and mihnita April 13, 2026 13:51
@mihnita mihnita changed the title ICU-23366 Reduce the memory footprint subdivisionData in ValidIdentif… ICU-23366 Reduce the memory footprint subdivisionData in ValidIdentifiers Apr 13, 2026
@markusicu markusicu self-assigned this Apr 13, 2026
@markusicu
Copy link
Copy Markdown
Member

@jabagawee FYI

@jira-pull-request-webhook
Copy link
Copy Markdown

Notice: the branch changed across the force-push!

  • icu4j/main/core/src/main/java/com/ibm/icu/impl/ValidIdentifiers.java is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@gvictor gvictor changed the title ICU-23366 Reduce the memory footprint subdivisionData in ValidIdentifiers ICU-23371 Reduce the memory footprint subdivisionData in ValidIdentifiers Apr 14, 2026
…iers

HashSet internally uses HashMap requests extra memory footprints for
each entry. Use Set.copyOf(Set) to avoid the memory overhead
The heap dump shows ~351kB reduction.

Also, use Map.copyOf(map) instead of HashMap. It reduces the memory
footprint by ~52kB.
@jira-pull-request-webhook
Copy link
Copy Markdown

Notice: the branch changed across the force-push!

  • icu4j/main/core/src/main/java/com/ibm/icu/impl/ValidIdentifiers.java is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@gvictor gvictor requested a review from mihnita April 14, 2026 14:26
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.

3 participants