【发布时间】:2014-04-01 11:30:56
【问题描述】:
问题是 IIS 工作进程消耗大量内存。在使用 VMMAP 检查 w3wp 进程后,我注意到私有 WS 的最大组件是托管堆,即 GC 内存。
进一步,我使用Performance Monitoring检查了w3wp进程,结果如下:
# Bytes in All Heaps : 32MB
# Gen 0 Collections : 4
# Gen 1 Collections : 3
# Gen 2 Collections : 2
Gen 0 Heap Size 570MB
Gen 1 Heap Size 5MB
Gen 2 Heap Size 26MB
Active Sessions : 4
Gen 0 堆大小随着每个新会话而增加。高峰是当我有 4 个活动会话(~570MB)时。当我有 6 个会话时,它会减少到 ~250MB,然后再次增加,直到应用程序池被回收(~8-9 个活动会话)。
据我所知,Gen 0 堆大小必须非常小(与 L2 缓存相当),这是触发 GC 运行 Gen 0 GC 的大小。
为什么第 0 代堆大小如此之大?
我有以下环境:
IIS 6.0
The application is Asp.Net WebForms
Application Pool is restricted to 700Mb, and it gets recycled when
I have ~8-9 active sessions, so all session are lost.
.Net Framework v4.0.3
64 bit version of w3wp worker.
I also inspected the application memory using CLR profiler and the
number of Bytes in all heaps are 10-60 mb depending on number of active sessions.
谢谢!
【问题讨论】:
标签: asp.net iis garbage-collection