Release chunk data buffer after copy page data from it in aligned series FastCompaction #11046
Closed
shuwenwei wants to merge 11 commits intoapache:masterfrom
Closed
Release chunk data buffer after copy page data from it in aligned series FastCompaction #11046shuwenwei wants to merge 11 commits intoapache:masterfrom
shuwenwei wants to merge 11 commits intoapache:masterfrom
Conversation
xingtanzjr
reviewed
Sep 7, 2023
| this.pointReader = | ||
| ((AlignedChunkReader) iChunkReader) | ||
| .getPagePointReader(pageHeader, valuePageHeaders, pageData, valuePageDatas); | ||
| if (this.iChunkReader == null) { |
Contributor
There was a problem hiding this comment.
What does iChunkReader == null mean ?
Member
Author
There was a problem hiding this comment.
The variable 'iChunkReader' was not set during construction when the series of this PageElement is aligned.
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.
Description
When FastCompaction deserializes a overlapped Chunk into the Page queue, the ByteBuffer.get() method is called from the Chunk's Buffer to copy the data of each Page. After copy, the Page is wrapped into a PageElement and put into the pageQueue, but the timeChunk and valueChunks are passed into a new instance of AlignedChunkReader, which causes the clearChunks method to be called at the end of the method is not effective. The reference of each Chunk is still held by AlignedChunkReader and cannot be released. At this time, there is 2 times the chunk size of data in the memory.
Fix
Release chunk data buffer after copy page data from it.