Can the .NET MethodInfo cache be cleared or disabled?
Posted
by Anton
on Stack Overflow
See other posts from Stack Overflow
or by Anton
Published on 2010-06-17T20:27:54Z
Indexed on
2010/06/17
20:33 UTC
Read the original article
Hit count: 198
Per MSDN, calling Type.GetMethods()
stores reflected method information in a MemberInfo
cache so the expensive operation doesn't have to be performed again.
I have an application that scans assemblies/types, looking for methods that match a given specification. The problem is that memory consumption increases significantly (especially with large numbers of referenced assemblies) since .NET hangs onto the method metadata.
Is there any way to clear or disable this MemberInfo
cache?
© Stack Overflow or respective owner