How can you specify and determine the memory limit of an ASP.NET application

T

Tomas

I have two questions:

(1)
How (if possible) can you, with ASP.NET (and with the IIS 5 included
with win2000) specify an maximum limit of the memory that a web
application may consume, as an absolute number of megabytes ???
( I am aware of the "memoryLimit" attribute in the "processModel"
element in the Web.config but that only specifies the maximum allowed
memory size, as a percentage of total system memory, and I don't want
a percentage but a number of megabytes)

(2)
How (if possible) can you, programmatically determine how many
megabytes of the memory that is currently available for *my asp.net
application* ???
Note that I am *not* interested in the totally amount of currently
unused memory of the entire machine, but only how much more memory
*my* web application may consume.


My reason for asking these questions is that I am running an asp.net
site with a web host with a win2003 server with IIS 6 and they have
assigned each customer/application a specific amount of memory as a
number of megabytes, but as far as I know this is a new feature of a
win2003/IIS6 application pool which I therefore can not use on my own
win2000 machine, or is there some way of specifying a memory limit
with asp.net and win2000 ?

I myself only have a win2000 machine, which I use for developing/
testing my site locally and I would like to try the web application
locally until I have made sure that it does not use more memory than
the upper limit at the web host, because when it consumes that much
memory it seems to make the entire web app totally unavailable even
including all the static html pages.

Regarding my second question, I am running some threads in the
background which are triggered when users accecces certatin pages
(the purpose of these threads is to do some quite demanding stuff that
might otherwise make the accesses to asp pages slow).
However, from these threads I would like to check how much memory is
available for *my* application so I can exit from the thread if I am
running out of memory, instead of keep consuming memory until the
entire web application becomes unavailable.

/ Tomas
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top