Reduce heap size needed by PrintUtility#3627
Open
lbschanno wants to merge 3 commits into
Open
Conversation
The PrintUtility class forces us to allocate 2g heaps for unit tests due to attempting to decoded non-HyperLogLogPlus cardinality values as such. The HyperLogLogPlus.legacyDecode() method will at times allocate a very large byte array larger than 1g. Add the class PrintUtility.TableWriter to handle writing entries of a table to an output. This class can be configured with custom key, timestamp, and Value formatters. Add constant instances of TableWriter to PrintUtility that handle writing entries for specific tables, such as shard, metadata, facet, etc. This allows for targeted formatting to avoid accidentally decoding a non-HyperLogLogPlus cardinality value as such. Update all usages of PrintUtility to call the new methods, and reduce the allocated heap size for unit tests to 1g. Fixes #3248
apmoriarty
previously approved these changes
Jun 23, 2026
avgAGB
reviewed
Jun 25, 2026
avgAGB
approved these changes
Jun 26, 2026
apmoriarty
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PrintUtility class forces us to allocate 2g heaps for unit tests due to attempting to decoded non-HyperLogLogPlus cardinality values as such. The HyperLogLogPlus.legacyDecode() method will at times allocate a very large byte array larger than 1g.
Add the class PrintUtility.TableWriter to handle writing entries of a table to an output. This class can be configured with custom key, timestamp, and Value formatters.
Add constant instances of TableWriter to PrintUtility that handle writing entries for specific tables, such as shard, metadata, facet, etc. This allows for targeted formatting to avoid accidentally decoding a non-HyperLogLogPlus cardinality value as such.
Update all usages of PrintUtility to call the new methods, and reduce the allocated heap size for unit tests to 1g.
Fixes #3248