-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Pipe: release resources of pipe event that have been GCed but the reference count is not zero by PhantomReference #13360
Conversation
return PIPE_EVENT_PHANTOM_REFERENCES.size(); | ||
} | ||
|
||
protected void gcHook() { |
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.
Use a seperated thread pool (extends PipePeriodicalJobExecutor?) to run this method periodically?
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.
For one thread, what is the max number of events per second can be checked?
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.
We have to consider using a multi-threaded pool to run this method if necessary (maybe we can add a conf parma for this?)
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.
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", |
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.
Can be shorter by default?
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.
no other ideas for now...
…erence count is not zero by PhantomReference (apache#13360)
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).