Problem: w3wp is memory bound


A

Anand Saha

Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
OS: Windows Server 2003 R2 Ent Edition, SP2
Web Server: IIS 6
ASP.NET ver: 2.0

I made a simple ASP.NET application, with only this code in the
Page_Load, to
simulate a condition where huge memory is utilized by the app:

int i = 0;
int j = 0;
StringBuilder[] sb = new StringBuilder[3000];

while (i < 3000)
{
sb = new StringBuilder(9999999);

j = 0;
while (j < (9999999))
{
sb.Append('a');
j++;
}
Console.WriteLine(i.ToString());
i++;
}


When I invoke Default.aspx from IE, the w3wp process memory use
increases, goes
till around 1.3 GB, and then the app crashes out with
OutOfMemoryException, w3wp
recycles.

In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
Virtual memory',
both for the App Pool. In Machine.Config, memoryLimit is set at 100%.

I am unable to find out why the app is not going beyond 1.3 GB of
memory usage.

Any pointers will be helpful.

Thanks,
Anand
--
 
Ad

Advertisements

A

Anand Saha

Patrice,

This small experiment is to solve a bigger problem - that with Report
Server 2005.

We have a report which sucks huge amount of data from the database.
And in the process of
producing the report, the Report Server crashes with
OutOfMemoryException. .

Its actually the w3wp which terminates when it reaches 1.3GB, and till
now the mystery is
still unsolved, as to why the number 1.3 ? An immediate reaction would
be that its 60% of the
2 GB that you mentioned, but I made sure that machine.config has 100
in the memoryLimit parameter.

And on further investigation, I found that this has nothing to do with
Report Server, as a small web app
like the one i posted shows the same behavior.

The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
So its frustrating that
the process uses just 1.3 GB

Anand
--

AFAIK unless an application is explicitly written to take advantage of it, a
single process can use 2 Gb at best plus you likely need some more memory
during the GC (when it moves something it needs at least the source object
and the copy).

Note that it doesn't mean *all* requests won't use more, it means that
*each* request won't be able to use more memory.

Someone more knowledgable will likely popup but this is my understanding for
now. Also knowing if you are trying to solve something or if this is just to
see how it behaves could perhaps help...

My first thought would be to see if you can go beyond this when issuing
multiple queries at the same time (not sure thought what you are trying to
find out)...

--
Patrice

"Anand Saha" <[email protected]> a écrit dans le message de groupe de
discussion :
(e-mail address removed)...
Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
OS: Windows Server 2003 R2 Ent Edition, SP2
Web Server: IIS 6
ASP.NET ver: 2.0
I made a simple ASP.NET application, with only this code in the
Page_Load, to
simulate a condition where huge memory is utilized by the app:
    int i = 0;
           int j = 0;
           StringBuilder[] sb = new StringBuilder[3000];
           while (i < 3000)
           {
               sb = new StringBuilder(9999999);

               j = 0;
               while (j < (9999999))
               {
                   sb.Append('a');
                   j++;
               }
               Console.WriteLine(i.ToString());
               i++;
           }

When I invoke Default.aspx from IE, the w3wp process memory use
increases, goes
till around 1.3 GB, and then the app crashes out with
OutOfMemoryException, w3wp
recycles.
In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
Virtual memory',
both for the App Pool. In Machine.Config, memoryLimit is set at 100%.
I am unable to find out why the app is not going beyond 1.3 GB of
memory usage.
Any pointers will be helpful.
Thanks,
Anand
--  
 
B

bruce barker

you are confusing parameters. the max memory in the config, specifies the
runtime max (target for GC) and a forced recycle will happen if more memory
is used. you are getting a out-of-memory message, which is call to the o/s to
get more memory, which is failing.

asp.net does not support PAE (which is a memory swapping scheme requiring
application support and used mainly for caching), so the max memory it can be
allocated (on a 32bit o/s) is 2gb. as the process virtual page table (list
of all pages used by a process, with necessary mapping info) goes into user
space, a process can not actually access 2gb of memory. there is other
control stuff in user memory, whoich lead to the max working set size (which
can depend on which serive packs are installed). your test shows that on
your server configuartion, 1.3 is about the max working set size.

unless you have a lot of app pools (each which can grow to max working set
size), 38 gb is really a waste. you should switch to a 64bit o/s to get any
use of this memory.

-- bruce (sqlwork.com)


Anand Saha said:
Patrice,

This small experiment is to solve a bigger problem - that with Report
Server 2005.

We have a report which sucks huge amount of data from the database.
And in the process of
producing the report, the Report Server crashes with
OutOfMemoryException. .

Its actually the w3wp which terminates when it reaches 1.3GB, and till
now the mystery is
still unsolved, as to why the number 1.3 ? An immediate reaction would
be that its 60% of the
2 GB that you mentioned, but I made sure that machine.config has 100
in the memoryLimit parameter.

And on further investigation, I found that this has nothing to do with
Report Server, as a small web app
like the one i posted shows the same behavior.

The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
So its frustrating that
the process uses just 1.3 GB

Anand
--

AFAIK unless an application is explicitly written to take advantage of it, a
single process can use 2 Gb at best plus you likely need some more memory
during the GC (when it moves something it needs at least the source object
and the copy).

Note that it doesn't mean *all* requests won't use more, it means that
*each* request won't be able to use more memory.

Someone more knowledgable will likely popup but this is my understanding for
now. Also knowing if you are trying to solve something or if this is just to
see how it behaves could perhaps help...

My first thought would be to see if you can go beyond this when issuing
multiple queries at the same time (not sure thought what you are trying to
find out)...

--
Patrice

"Anand Saha" <[email protected]> a écrit dans le message de groupe de
discussion :
(e-mail address removed)...
Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
OS: Windows Server 2003 R2 Ent Edition, SP2
Web Server: IIS 6
ASP.NET ver: 2.0
I made a simple ASP.NET application, with only this code in the
Page_Load, to
simulate a condition where huge memory is utilized by the app:
int i = 0;
int j = 0;
StringBuilder[] sb = new StringBuilder[3000];
while (i < 3000)
{
sb = new StringBuilder(9999999);

j = 0;
while (j < (9999999))
{
sb.Append('a');
j++;
}
Console.WriteLine(i.ToString());
i++;
}

When I invoke Default.aspx from IE, the w3wp process memory use
increases, goes
till around 1.3 GB, and then the app crashes out with
OutOfMemoryException, w3wp
recycles.
In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
Virtual memory',
both for the App Pool. In Machine.Config, memoryLimit is set at 100%.
I am unable to find out why the app is not going beyond 1.3 GB of
memory usage.
Any pointers will be helpful.
Thanks,
Anand
--

 
A

Anand Saha

Thanks Patrice.


Try perhapshttp://support.microsoft.com/kb/909678/en-us.

Also a quick search seems to show that RS2008 has an improved architecture
to overcome this limit
(http://blogs.msdn.com/bwelcker/archive/2007/12/04/everybody-why-leave...).

The microsoft.public.sqlserver.reportingsvcs could be better for this RS
related issue. Good luck.

--
Patrice

"Anand Saha" <[email protected]> a écrit dans le message de groupe de
discussion :
(e-mail address removed)...
This small experiment is to solve a bigger problem - that with Report
Server 2005.
We have a report which sucks huge amount of data from the database.
And in the process of
producing the report, the Report Server crashes with
OutOfMemoryException. .
Its actually the w3wp which terminates when it reaches 1.3GB, and till
now the mystery is
still unsolved, as to why the number 1.3 ? An immediate reaction would
be that its 60% of the
2 GB that you mentioned, but I made sure that machine.config has 100
in the memoryLimit parameter.
And on further investigation, I found that this has nothing to do with
Report Server, as a small web app
like the one i posted shows the same behavior.
The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
So its frustrating that
the process uses just 1.3 GB

AFAIK unless an application is explicitly written to take advantage of
it, a
single process can use 2 Gb at best plus you likely need some more memory
during the GC (when it moves something it needs at least the source
object
and the copy).
Note that it doesn't mean *all* requests won't use more, it means that
*each* request won't be able to use more memory.
Someone more knowledgable will likely popup but this is my understanding
for
now. Also knowing if you are trying to solve something or if this is just
to
see how it behaves could perhaps help...
My first thought would be to see if you can go beyond this when issuing
multiple queries at the same time (not sure thought what you are trying
to
find out)...
--
Patrice
"Anand Saha" <[email protected]> a écrit dans le message de groupe de
discussion :
(e-mail address removed)...
Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
OS: Windows Server 2003 R2 Ent Edition, SP2
Web Server: IIS 6
ASP.NET ver: 2.0
I made a simple ASP.NET application, with only this code in the
Page_Load, to
simulate a condition where huge memory is utilized by the app:
int i = 0;
int j = 0;
StringBuilder[] sb = new StringBuilder[3000];
while (i < 3000)
{
sb = new StringBuilder(9999999);
j = 0;
while (j < (9999999))
{
sb.Append('a');
j++;
}
Console.WriteLine(i.ToString());
i++;
}
When I invoke Default.aspx from IE, the w3wp process memory use
increases, goes
till around 1.3 GB, and then the app crashes out with
OutOfMemoryException, w3wp
recycles.
In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
Virtual memory',
both for the App Pool. In Machine.Config, memoryLimit is set at 100%..
I am unable to find out why the app is not going beyond 1.3 GB of
memory usage.
Any pointers will be helpful.
Thanks,
Anand
--
 
Ad

Advertisements

A

Anand Saha

Thanks Bruce for the insight. We are trying out the 64 bit option,
will report the results here.


you are confusing parameters. the max memory in the config, specifies the
runtime max (target for GC) and a forced recycle will happen if more memory
is used. you are getting a out-of-memory message, which is call to the o/s to
get more memory, which is failing.

asp.net does not support PAE (which is a memory swapping scheme requiring
application support and used mainly for caching), so the max memory it can be
allocated (on a 32bit o/s) is 2gb.  as the process virtual page table (list
of all pages used by a process, with necessary mapping info) goes into user
space, a process can not actually access 2gb of memory. there is other
control stuff in user memory, whoich lead to the max working set size (which
can depend on which serive packs are installed).  your test shows that on
your server configuartion, 1.3 is about the max working set size.

unless you have a lot of app pools (each which can grow to max working set
size), 38 gb is really a waste. you should switch to a 64bit o/s to get any
use of this memory.

-- bruce (sqlwork.com)

Anand Saha said:
This small experiment is to solve a bigger problem - that with Report
Server 2005.
We have a report which sucks huge amount of data from the database.
And in the process of
producing the report, the Report Server crashes with
OutOfMemoryException. .
Its actually the w3wp which terminates when it reaches 1.3GB, and till
now the mystery is
still unsolved, as to why the number 1.3 ? An immediate reaction would
be that its 60% of the
2 GB that you mentioned, but I made sure that machine.config has 100
in the memoryLimit parameter.
And on further investigation, I found that this has nothing to do with
Report Server, as a small web app
like the one i posted shows the same behavior.
The OS boots with the /PAE flag, and we have 32 GB RAM in the machine.
So its frustrating that
the process uses just 1.3 GB

AFAIK unless an application is explicitly written to take advantage of it, a
single process can use 2 Gb at best plus you likely need some more memory
during the GC (when it moves something it needs at least the source object
and the copy).
Note that it doesn't mean *all* requests won't use more, it means that
*each* request won't be able to use more memory.
Someone more knowledgable will likely popup but this is my understanding for
now. Also knowing if you are trying to solve something or if this is just to
see how it behaves could perhaps help...
My first thought would be to see if you can go beyond this when issuing
multiple queries at the same time (not sure thought what you are trying to
find out)...
--
Patrice
"Anand Saha" <[email protected]> a écrit dans le message de groupe de
discussion :
(e-mail address removed)...
Machine: 32 bit Intel Xeon 2.93 GHz, 16 CPUs, 32 GB RAM
OS: Windows Server 2003 R2 Ent Edition, SP2
Web Server: IIS 6
ASP.NET ver: 2.0
I made a simple ASP.NET application, with only this code in the
Page_Load, to
simulate a condition where huge memory is utilized by the app:
    int i = 0;
           int j = 0;
           StringBuilder[] sb = new StringBuilder[3000];
           while (i < 3000)
           {
               sb = new StringBuilder(9999999);
               j = 0;
               while (j < (9999999))
               {
                   sb.Append('a');
                   j++;
               }
               Console.WriteLine(i.ToString());
               i++;
           }
When I invoke Default.aspx from IE, the w3wp process memory use
increases, goes
till around 1.3 GB, and then the app crashes out with
OutOfMemoryException, w3wp
recycles.
In IIS, the 'Max Used memory' value is set at 4 GB, so is the 'Max
Virtual memory',
both for the App Pool. In Machine.Config, memoryLimit is set at 100%.
I am unable to find out why the app is not going beyond 1.3 GB of
memory usage.
Any pointers will be helpful.
Thanks,
Anand
--  
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top