Skip to content
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

[sdk] Optimize Task memory usage after completion #712

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Enet4
Copy link
Collaborator

@Enet4 Enet4 commented Jan 9, 2025

Summary

  • when the task is done, remove references to callable and complete hooks so that the GC can sweep them
  • add try-catch safeguard around completion hook calls
  • reduce default capabity of toRunWhenComplete (usually only 1 or 2 hooks are attached, so there is no need for more capacity)
  • override protected method done() instead of set(V) for calling complete hooks as well as the clean-up
  • remove uses of raw types

- when the task is done,
  remove references to callable and complete hooks
  so that the GC can sweep them
- add try-catch safeguard around completion hook calls
- reduce default capabity of toRunWhenComplete
 (usually only 1 or 2 hooks are employed)
- use protected method done() instead of set(V)
  for calling complete hooks as well as the clean-up
- no raw types
@Enet4 Enet4 self-assigned this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant