aspnet_wp process taking up *huge* amounts of memory

aspnet_wp process taking up *huge* amounts of memory

Post by Defianc » Thu, 28 Feb 2002 07:48:35



Hiya,

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
browser+Page
makes it rise another 0.5 - 1 MB.. And opening another Browser+page
(different 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
pages
on my server.. Now the thing that scared me was.. after about 30 minutes the
amount
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
1.0.3705

greets Jim

 
 
 

aspnet_wp process taking up *huge* amounts of memory

Post by Michael Schaef » Fri, 01 Mar 2002 10:21:29


Jim

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
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...
l/cpconautomaticmemorymanagement.asp

To get a better handle on your actual memory usage, you can use different
Memory Performance Counters:

Memory Performance Counters
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpge...
ml/gngrfmemoryperformancecounters.asp

If you wish, you can also write code specifically handle garbage collection:

Programming for Garbage Collection
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...
l/cpconprogrammingessentialsforgarbagecollection.asp

Overall, it sounds to me that the situation you are seeing might be normal.

Hope this helps!

Michael Schaefer
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
browser+Page
makes it rise another 0.5 - 1 MB.. And opening another Browser+page
(different 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
pages
on my server.. Now the thing that scared me was.. after about 30 minutes the
amount
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
1.0.3705

greets Jim

 
 
 

aspnet_wp process taking up *huge* amounts of memory

Post by Defianc » Sat, 02 Mar 2002 04:51:49


mm Indeed it sounds like it's supposed to be this way.. It doesnt matter to
much for me
since I have enough Memory to spare anyways, I just thought it was a little
strange to hava single process use up that much mem..

Anyways, thanx for the info :)


Quote:> Jim

> 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

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...
Quote:> l/cpconautomaticmemorymanagement.asp

> To get a better handle on your actual memory usage, you can use different
> Memory Performance Counters:

> Memory Performance Counters

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpge...
Quote:> ml/gngrfmemoryperformancecounters.asp

> If you wish, you can also write code specifically handle garbage
collection:

> Programming for Garbage Collection

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...

- Show quoted text -

> l/cpconprogrammingessentialsforgarbagecollection.asp

> Overall, it sounds to me that the situation you are seeing might be
normal.

> Hope this helps!

> Michael Schaefer
> 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
> browser+Page
> makes it rise another 0.5 - 1 MB.. And opening another Browser+page
> (different 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
> pages
> on my server.. Now the thing that scared me was.. after about 30 minutes
the
> amount
> 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
> 1.0.3705

> greets Jim

 
 
 

1. aspnet_wp.exe taking too much memory

Hi!

I'm currently developping a web application using asp.net.  Before starting
the application, aspnet_wp.exe takes about 2.5mb of memory but it doesn't
take long before it reaches 35mb and even after stopping the application, it
still takes 35mb...  What am I doing wrong and what can I do to free some
memory?  Will it get worst when multiple users run the app?  Is it in
aspnet_wp.exe memory usage that session variables are stoked for each user?

Thanks in advance!

2. more russian beauty... Hot blonde

3. ASP .NET application consumes huge amount of ressources

4. problems with scp from openssh to ssh

5. MSXML, C# and huge memory leak

6. Is this a bug? Can't validate XML within Visual Studio when XSD is not in current solution?

7. Draw image HUGE memory load ??????

8. basic warning

9. HUGE memory usage while loading images

10. Huge Form, Huge Headache (small classic question)

11. Dataset taking A LOT of memory

12. Dataset taking A LOT of memory (Update)

13. msdev.exe taking more and more memory