Skip to content

Instantly share code, notes, and snippets.

@rvazarkar
Last active October 23, 2017 19:16
Show Gist options
  • Save rvazarkar/743afc27172fcc6b666b1b2da4703978 to your computer and use it in GitHub Desktop.
Save rvazarkar/743afc27172fcc6b666b1b2da4703978 to your computer and use it in GitHub Desktop.
namespace Sharphound2
{
//This class exists because of a memory leak in BlockingCollection. By setting the reference to Item to null after enumerating it,
//we can force garbage collection of the internal item, while the Wrapper is held by the collection.
//This is highly preferable because the internal item consumes a lot of memory while the wrapper barely uses any
class Wrapper<T>
{
public T Item { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment