Skip to content

Released memory retained by ExchangeSource#11097

Merged
losipiuk merged 1 commit intotrinodb:masterfrom
arhimondr:nullify-exchange-source
Feb 22, 2022
Merged

Released memory retained by ExchangeSource#11097
losipiuk merged 1 commit intotrinodb:masterfrom
arhimondr:nullify-exchange-source

Conversation

@arhimondr
Copy link
Copy Markdown
Contributor

Description

Avoid retaining memory used by ExchangeSource more than necessary

Is this change a fix, improvement, new feature, refactoring, or other?

Improvement

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Core engine

How would you describe this change to a non-technical end user or system administrator?

Non user visible improvement

Related issues, pull requests, and links

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

Comment on lines 496 to 499
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check needed? systemMemoryContext.setBytes(0); will always be executed in the finally block of close(), right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but pollPage and close can be called concurrently. It is possible that close will set the memory reservation to 0 while the pollPage will reset it back to a non zero value

@losipiuk
Copy link
Copy Markdown
Member

Typo in commit message "Released" -> "Release"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There two separate issues here. One improving GC and another is ensuring memory pool accounting is fine. It would be nice to have separated commits for them.

@arhimondr arhimondr force-pushed the nullify-exchange-source branch from b7d7dda to d023e5b Compare February 21, 2022 22:56
@losipiuk
Copy link
Copy Markdown
Member

CI: #11140

@losipiuk
Copy link
Copy Markdown
Member

CI: #4936

@losipiuk losipiuk merged commit ae713b7 into trinodb:master Feb 22, 2022
@github-actions github-actions bot added this to the 372 milestone Feb 22, 2022
@arhimondr arhimondr deleted the nullify-exchange-source branch February 22, 2022 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants