philiplaureano / LinFu

A framework that adds mixins, inversion of control, DbC, and other language features to the Common Language Runtime.
http://www.codeproject.com/KB/cs/LinFuPart1.aspx
206 stars 30 forks source link

OOM in IgnoredInstancesRegistry #32

Open DanielRose opened 8 years ago

DanielRose commented 8 years ago

I am using LinFu to work with proxy classes, allowing me to transparently store additional data. Over the lifetime of the process there may be many millions of intercepted calls.

Lately, I've been getting OutOfMemory exceptions on 32bit computers, which I tracked to the IgnoredInstancesRegistry. In there, every intercepted call is stored in a HashTable. The HashTable thus keeps getting bigger, fragmenting the large object heap and eventually causing the OOM.

Unfortuantely, there is no real documentation on the IgnoredInstancesRegistry. What is it supposed to be used for? Would it be possible to allow disabling its functionality?