-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(api): Optimize memory allocation for the eth_newFilter interface
#6495
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
base: release_v4.8.1
Are you sure you want to change the base?
fix(api): Optimize memory allocation for the eth_newFilter interface
#6495
Conversation
framework/src/main/java/org/tron/core/services/jsonrpc/TronJsonRpc.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/tron/core/services/jsonrpc/TronJsonRpcImpl.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/tron/core/services/jsonrpc/TronJsonRpcImpl.java
Outdated
Show resolved
Hide resolved
chainbase/src/main/java/org/tron/core/db2/core/SnapshotManager.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/tron/common/logsfilter/EventPluginLoader.java
Outdated
Show resolved
Hide resolved
|
|
||
| @Override | ||
| public void close() throws IOException { | ||
| logElementCache.invalidateAll(); |
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.
Is it necessary to call invalidateAll()?
The close() method is invoked when the application is about to stop completely. When the entire application (the JVM process) exits, all the memory it occupies, including all objects stored in the logElementCache, will be automatically reclaimed by the operating system.
At the very last moment before the application shuts down, would manually clearing a memory cache that is about to vanish along with it (i.e., invalidateAll()) consume the final CPU cycles to perform a meaningless task?
waynercheung
left a comment
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.
LGTM
What does this PR do?
Why are these changes required?
This PR has been tested by:
Follow up
Extra details