Reputation: 138
The problem is that IIS worker consumes to much memory. After inspecting the w3wp process with VMMAP I noticed that the bigest component of the Private WS is the Managed Heap, the GC memory.
Further, I inspected the w3wp process using Performance Monitoring, and the results were as follows:
# 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 heap size is increased with every new session. The peak is when I have 4 active session(~570MB). Than when I have 6 session it decreases to ~250MB and than increases again until the application pool is recycled(~8-9 active sessions).
As I know the Gen 0 heap size has to be very small(comparable with the L2 Cache) and this is the size that triggers the GC to run Gen 0 GCs.
Why is the Gen 0 heap size so big?
I have the following enviroment:
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.
Thank you!
Upvotes: 0
Views: 1412
Reputation: 63173
http://msdn.microsoft.com/en-us/library/ee817660.aspx
Use WinDbg or any commercial .NET memory profiler, you should be able to review what are the objects in the heap and whether they should be there.
Common causes are string manipulation without StringBuilder
and big objects in session such as DataTable
.
Find the exact cause in your case and remedy it.
Upvotes: 1