I'm loading several external assemblies into my application at runtime. And I need to limit an amount of memory that can be used by a specific class which is defined in each of the external assemblies, for example, 10 mb per instance, otherwise we get OutOfMemory.
I've googled what is the best way to do this and found some information about CLR Runtime Hosting. It seems to be the thing I need, but I can not find any good examples.
Can anyone share the examples of code or maybe some links about memory management using CLR Runtime Hosting? Or maybe there are some better solutions to limit an amount of memory per class?
Thanks in advance.