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

Fix for #506 - Prune dead elements from IndexReader.parentReaders collection when they go out of scope #509

Merged
merged 3 commits into from
Sep 16, 2021

Conversation

NightOwl888
Copy link
Contributor

  • BUG: Lucene.Net.Index.IndexReader: Use ConditionalWeakTable<TKey, TValue>/WeakDictionary<TKey, TValue> to ensure dead elements are pruned and garbage collected (fixes IdentityWeakReference should be IDisposable #506).
  • Changed backing object for WeakKey of WeakDictionary<TKey, TValue> from WeakReference to WeakReference<T>.
  • Changed backing collection of WeakDictionary<TKey, TValue> to ConcurrentDictionary<TKey, TValue> to allow the Clean() method to remove items while iterating forward instead of instantiating a new collection.

…ce<T> instead of WeakReference to avoid problems with garbage collection (see apache#506).
…N.Collections.Generic.Dictionary<TKey, TValue> to ConcurrentDictionary<TKey, TValue> to allow reap to function while doing a forward iteration through the collection.
…onary to ensure dead elements are pruned and garbage collected (fixes apache#506).
@eladmarg eladmarg mentioned this pull request Aug 18, 2021
@NightOwl888 NightOwl888 merged commit 89bad64 into apache:master Sep 16, 2021
@NightOwl888 NightOwl888 added this to the 4.8.0-beta00015 milestone Oct 24, 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

Successfully merging this pull request may close these issues.

IdentityWeakReference should be IDisposable
1 participant