-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve interning in SQLMetadataSegmentManager #6357
Improve interning in SQLMetadataSegmentManager #6357
Conversation
Also related to #6358, that I intend to fix later. |
/** | ||
* For the garbage collector in Java, it's better to keep new objects short-living, but once they are old enough | ||
* (i. e. promoted to old generation), try to keep them alive. In {@link #poll()}, we fetch and deserialize all | ||
* existing segments each time, and them replace them in {@link #dataSourcesRef}. This method allows to use already |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
* Improve interning in SQLMetadataSegmentManager * typo
The segments that are stored in
SQLMetadataSegmentManager.DATA_SEGMENT_INTERNER
are the same as inSQLMetadataSegmentManager.dataSourcesRef
, so we could effectively use the latter for interning. It allows to get rid of one large Map of weak references which are probably bad for GC themselves.Also interning doesn't make sense in
enableDatasource()
.Originally interning was introduced in #3267.