【发布时间】:2018-05-06 13:12:30
【问题描述】:
我们最近在我们的应用中实现了 ASP.NET 捆绑和缩小。
这应该让它更快......它加快了下载速度,但自从它上线以来,内存使用量上升了。
我刚刚按照 ASP.Net Worker Process Memory Profile Tools 进行了内存转储,并查看了 WinDbg 的结果,以及消耗最多内存的东西
00007ffd809d0ee0 4478 1676592 System.Collections.Generic.Dictionary`2+Entry[[System.String, mscorlib],[System.Xml.XmlDictionaryString, System.Runtime.Serialization]][]
00007ffdcd9bed78 14077 1689240 System.Reflection.RuntimeParameterInfo
00007ffdcd9bbb58 44987 2159376 System.Text.StringBuilder
00007ffd81166738 80376 2572032 Microsoft.Ajax.Utilities.CssContext
00007ffdcd9b9220 41647 2867112 System.Int32[]
00007ffdcd9bf100 27654 3097248 System.Reflection.RuntimeMethodInfo
00007ffd81166600 80364 3214560 Microsoft.Ajax.Utilities.CssToken
00007ffdcd9bd1e0 11875 4132224 System.Collections.Hashtable+bucket[]
00007ffdcd9b6fc0 37793 4331968 System.Object[]
00007ffdcd9b7a98 50153 8237258 System.Char[]
0000003495080610 41499 9288392 Free
00007ffd81166868 401856 9644544 Microsoft.Ajax.Utilities.Position
00007ffdcd9b6948 520475 31605586 System.String
00007ffdcd9bc988 38797 86558836 System.Byte[]
(在列表底部)都是 Microsoft.Ajax.Utilities 类。
所以看起来捆绑以某种方式泄漏内存。是否有任何常见原因导致这种情况发生?很多捆绑的东西都发生在黑盒子里,很难知道我们做错了什么。我们叫
BundleConfig.RegisterBundles(BundleTable.Bundles);
在 Application_Start 中,我想就是这样。
【问题讨论】:
标签: c# asp.net memory-leaks bundling-and-minification