Skip to content

Release chunk data buffer after copy page data from it in aligned series FastCompaction #11046

Closed
shuwenwei wants to merge 11 commits intoapache:masterfrom
shuwenwei:avoid-refer-chunk
Closed

Release chunk data buffer after copy page data from it in aligned series FastCompaction #11046
shuwenwei wants to merge 11 commits intoapache:masterfrom
shuwenwei:avoid-refer-chunk

Conversation

@shuwenwei
Copy link
Copy Markdown
Member

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.

@shuwenwei shuwenwei changed the title Release chunk data buffer after copy page data from it Release chunk data buffer after copy page data from it in FastCompaction Sep 5, 2023
@shuwenwei shuwenwei changed the title Release chunk data buffer after copy page data from it in FastCompaction Release chunk data buffer after copy page data from it in aligned series FastCompaction Sep 5, 2023
this.pointReader =
((AlignedChunkReader) iChunkReader)
.getPagePointReader(pageHeader, valuePageHeaders, pageData, valuePageDatas);
if (this.iChunkReader == null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does iChunkReader == null mean ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'iChunkReader' was not set during construction when the series of this PageElement is aligned.

@HTHou HTHou closed this Jan 10, 2024
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