When you initialize a new process, the runtime reserves a contiguous region
of address space for the process. This reserved address space is called the
managed heap. The managed heap maintains a pointer to the address where the
next object in the heap will be allocated. Initially, this pointer is set
to the managed heap's base address. All reference types are allocated on
the managed heap. When an application creates the first reference type,
memory is allocated for the type at the base address of the managed heap.
When the application creates the next object, the garbage collector
allocates memory for it in the address space immediately following the
first object. As long as address space is available, the garbage collector
continues to allocate space for new objects in this manner.
Note that memory is compacted only if a collection discovers a significant
number of unreachable objects. If all the objects in the managed heap
survive a collection, then there is no need for memory compaction.
To improve performance, the runtime allocates memory for large objects in a
separate heap. The garbage collector automatically releases the memory for
large objects. However, to avoid moving large objects in memory, this
memory is not compacted.
Those paragraphs were taken from the following article:
Automatic Memory Management
To get a better handle on your actual memory usage, you can use different
Memory Performance Counters:
Memory Performance Counters
If you wish, you can also write code specifically handle garbage collection:
Programming for Garbage Collection
Overall, it sounds to me that the situation you are seeing might be normal.
Hope this helps!
This posting is provided "AS IS" with no warranties, and confers no rights.
Subject: aspnet_wp process taking up *huge* amounts of memory
I was just looking at my taskmanager and to see what my memory status was,
and I noticed something wich I find quite disturbing.
At system startup a process gets launched called 'aspnet_wp' .
At process startup time this process takes up about 1.2 - 1.5 MB of memory.
Now, when a user opens up an aspx page on the server, the memory used
by his process suddenly jumps up to about 16MB's. Opening up another
makes it rise another 0.5 - 1 MB.. And opening another Browser+page
that is, cos it needs to be recompiled) makes it rise again etc etc..
I have monitored this for a while and asked a few ppl to look up some aspx
on my server.. Now the thing that scared me was.. after about 30 minutes the
of memory used by the aspnet_wp process had risen to 63 Megs(!)..
Since my server usually never gets any users (except for me)
and the fact that I have 1.2 GB of physical memory, doesnt make me
worry to much, but what about servers that have huge amounts of
simultanious lookups and not as much memory to spare? They would
run out of mem sooner later..
I know, each page gets compiled only once in every session, but
since every compiled page adds another half MB at least to the amount
of system memory used, the limit will be reached very soon..
Is this normal or is something wrong with my setup?
spec: Windows 2000 professional (IIS5) with .NET framework SDK version