Pipe: release resources of pipe event that have been GCed but the reference count is not zero by PhantomReference#13360
Merged
SteveYurongSu merged 31 commits intoapache:masterfrom Oct 13, 2024
Conversation
| return PIPE_EVENT_PHANTOM_REFERENCES.size(); | ||
| } | ||
|
|
||
| protected void gcHook() { |
Member
There was a problem hiding this comment.
Use a seperated thread pool (extends PipePeriodicalJobExecutor?) to run this method periodically?
Member
There was a problem hiding this comment.
For one thread, what is the max number of events per second can be checked?
Member
There was a problem hiding this comment.
We have to consider using a multi-threaded pool to run this method if necessary (maybe we can add a conf parma for this?)
Contributor
Author
There was a problem hiding this comment.
consider optimizing in the next PR...
...ns/src/main/java/org/apache/iotdb/commons/pipe/resource/ref/PipePhantomReferenceManager.java
Outdated
Show resolved
Hide resolved
...ns/src/main/java/org/apache/iotdb/commons/pipe/resource/ref/PipePhantomReferenceManager.java
Outdated
Show resolved
Hide resolved
...ns/src/main/java/org/apache/iotdb/commons/pipe/resource/ref/PipePhantomReferenceManager.java
Show resolved
Hide resolved
| config.setPipeEventReferenceEliminateIntervalSeconds( | ||
| Long.parseLong( | ||
| properties.getProperty( | ||
| "pipe_event_reference_eliminate_interval_seconds", |
Member
There was a problem hiding this comment.
Can be shorter by default?
Contributor
Author
There was a problem hiding this comment.
no other ideas for now...
SteveYurongSu
approved these changes
Oct 13, 2024
VGalaxies
added a commit
to VGalaxies/iotdb
that referenced
this pull request
Oct 13, 2024
…erence count is not zero by PhantomReference (apache#13360)
VGalaxies
added a commit
to VGalaxies/iotdb
that referenced
this pull request
Dec 6, 2024
…erence count is not zero by PhantomReference (apache#13360)
SteveYurongSu
pushed a commit
that referenced
this pull request
Dec 6, 2024
…d but the reference count is not zero by PhantomReference (#13360, #13756, #13813, #13962, part of #13992) (#14355) * Pipe: release resources of pipe event that have been GCed but the reference count is not zero by PhantomReference (#13360) * Pipe: remove protected method reference under jdk8 & add GH yml for checking compatibility issues (#13756) * Pipe: add seperated thread pool for phantom reference clean job (#13813) * Pipe: reduce pipe phantom reference logging frequency by omitting printing if count unchanged (#13962) * cherry-pick part of #13992
Caideyipi
pushed a commit
to Caideyipi/iotdb
that referenced
this pull request
Mar 25, 2026
…d but the reference count is not zero by PhantomReference (apache#13360, apache#13756, apache#13813, apache#13962, part of apache#13992) (apache#14355) * Pipe: release resources of pipe event that have been GCed but the reference count is not zero by PhantomReference (apache#13360) * Pipe: remove protected method reference under jdk8 & add GH yml for checking compatibility issues (apache#13756) * Pipe: add seperated thread pool for phantom reference clean job (apache#13813) * Pipe: reduce pipe phantom reference logging frequency by omitting printing if count unchanged (apache#13962) * cherry-pick part of apache#13992
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.
Considering that when the event is garbage collected, the file resources it holds will not automatically end their lifecycle, we adopt a reference counting maintenance + safety net fallback method (releasing resources later is better than never releasing them).