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

Possible memory leak because of Transaction.Restart #473

Open
1 of 6 tasks
bigwad opened this issue Feb 16, 2021 · 1 comment
Open
1 of 6 tasks

Possible memory leak because of Transaction.Restart #473

bigwad opened this issue Feb 16, 2021 · 1 comment
Assignees

Comments

@bigwad
Copy link
Member

bigwad commented Feb 16, 2021

Starcounter version: 3.0.

Issue type

  • Bug
  • Feature request
  • Suggestion
  • Question
  • Cannot reproduce
  • Urgent

Issue description

Transaction object releases unmanaged memory in Dispose or in finalizer if a client fails to call Dispose. When a client calls Dispose, the transaction object removes itself from .Net finalization queue for the sake of performance.
Later, if we call Transaction.Restart on the disposed transaction, it allocates a new transaction, but doesn't put itself back in the finalization queue, thus making it possible to leak a memory if a client doesn't call Dispose again.

Either restarting of a disposed transaction should be prohibited or the transaction should be kept in the finalization queue in such scenario.

Reproduction code snippet

@bigwad
Copy link
Member Author

bigwad commented Feb 16, 2021

Worth mentioning. The issue is not something artificial - it's a kind of behavior Starcounter.Palindrom shows due to a yet unrevealed race condition. Using a disposed transaction object is ofc a bug on Starcounter.Palindrom side, but it shouldn't have such severe consequences as a memory leak.

@per-samuelsson per-samuelsson self-assigned this Jun 4, 2021
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

No branches or pull requests

2 participants