Skip to content

Conversation

@317787106
Copy link
Contributor

What does this PR do?

  • Optimize memory allocation for the eth_newFilter interface

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details


@Override
public void close() throws IOException {
logElementCache.invalidateAll();
Copy link
Contributor

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?

Copy link
Contributor

@waynercheung waynercheung left a comment

Choose a reason for hiding this comment

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

LGTM

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.

6 participants