Skip to content

Possible memory leak because of Transaction.Restart #473

@bigwad

Description

@bigwad

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions