我们目前正在寻找应用程序中的一些内存泄漏问题,当执行某些操作(在应用程序内加载和关闭一个项目)时,我们知道内存总是会稍微增加一点。
我们已经找到了很多问题,但现在,根据我们的工具(ANTS Memory Profiler 8.2),最大的10个增加类如下:
Microsoft.CSharp.RuntimeBinder.Semantics.SYMTBL+Key Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol Microsoft.CSharp.RuntimeBinder.Semantics.CONSTVAL Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCONSTANT Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCLASS Microsoft.CSharp.RuntimeBinder.Semantics.EXPRTYPEOF Microsoft.CSharp.RuntimeBinder.Semantics.EXPRLIST Microsoft.CSharp.RuntimeBinder.Semantics.MethWithInst Microsoft.CSharp.RuntimeBinder.Semantics.CMemberLookupResults Microsoft.CSharp.RuntimeBinder.Semantics.EXPRMEMGRP Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCALL Microsoft.CSharp.RuntimeBinder.Semantics.EXPRWRAP Microsoft.CSharp.RuntimeBinder.Semantics.AggregateDeclaration Microsoft.CSharp.RuntimeBinder.Semantics.Scope 不幸的是,我不知道这是什么,所以对我来说有点难找出如何释放和修改它们。
我检查了实例树,但它跟Microsoft的东西有着紧密关联。
问题在于当我们进行项目的“打开/关闭”时,我们要经过很多(大部分)我们的代码。
编辑1:我们的应用程序的一个部分使用
编辑2:我相信这与我的
我们已经找到了很多问题,但现在,根据我们的工具(ANTS Memory Profiler 8.2),最大的10个增加类如下:
Microsoft.CSharp.RuntimeBinder.Semantics.SYMTBL+Key Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol Microsoft.CSharp.RuntimeBinder.Semantics.CONSTVAL Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCONSTANT Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCLASS Microsoft.CSharp.RuntimeBinder.Semantics.EXPRTYPEOF Microsoft.CSharp.RuntimeBinder.Semantics.EXPRLIST Microsoft.CSharp.RuntimeBinder.Semantics.MethWithInst Microsoft.CSharp.RuntimeBinder.Semantics.CMemberLookupResults Microsoft.CSharp.RuntimeBinder.Semantics.EXPRMEMGRP Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCALL Microsoft.CSharp.RuntimeBinder.Semantics.EXPRWRAP Microsoft.CSharp.RuntimeBinder.Semantics.AggregateDeclaration Microsoft.CSharp.RuntimeBinder.Semantics.Scope 不幸的是,我不知道这是什么,所以对我来说有点难找出如何释放和修改它们。
我检查了实例树,但它跟Microsoft的东西有着紧密关联。
问题在于当我们进行项目的“打开/关闭”时,我们要经过很多(大部分)我们的代码。
编辑1:我们的应用程序的一个部分使用
dynamic
关键字访问一些资源,可能与此有关。这些类不可回收,我应该对它们做些特殊处理吗?编辑2:我相信这与我的
dynamic
相关,似乎C#在使用dynamic时会创建缓存。但目前我不知道为什么它会增长(我一直加载相同的类,并且始终具有完全相同的签名),也不知道如何清除它。
dynamic
使用有关,但我不明白为什么它会不断增长。 - J4N