473,325 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How to limit the memory size for asp.net cache

I set outputcache to 30 minutes for all .aspx pages on my asp.net 2.0
websites. If a search engine (such as Google) crawl my site, it can hit

thousands of pages within a few minutes and thus produce a large amount

of page caches. This could use a lot of memory and impact other
websites running on the same machine. My question is: how can I limit
the memory size (e.g. to 100MB) used by the cache?

I can set the following in web.config:
<cache privateBytesLimit = "128000000" />
This means the cache starts flushing expired items and attempting to
reclaim memory when memory size exceed 100MB. However if all cached
pages are unexpired, then no memory are reclaimed and memory size will
continue to grow as new pages get cached. How can I force cache to
remove items even if they are not expired yet so that memory will never

exceed 100MB? Is there a configuration setting to achieve this?
Ningjun

Jan 18 '07 #1
3 5589
To the best of my knowledge, this functionality is not supported. In any
case, a google crawl session will expire and the memory will be reclaimed so
you may want to lower the session time-out to have the reclaim be more
aggressive. Either that or stop worrying about it.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
<ni**********@lexisnexis.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
>I set outputcache to 30 minutes for all .aspx pages on my asp.net 2.0
websites. If a search engine (such as Google) crawl my site, it can hit

thousands of pages within a few minutes and thus produce a large amount

of page caches. This could use a lot of memory and impact other
websites running on the same machine. My question is: how can I limit
the memory size (e.g. to 100MB) used by the cache?

I can set the following in web.config:
<cache privateBytesLimit = "128000000" />
This means the cache starts flushing expired items and attempting to
reclaim memory when memory size exceed 100MB. However if all cached
pages are unexpired, then no memory are reclaimed and memory size will
continue to grow as new pages get cached. How can I force cache to
remove items even if they are not expired yet so that memory will never

exceed 100MB? Is there a configuration setting to achieve this?
Ningjun

Jan 20 '07 #2
I need to worry about memory during a Google crawl because there are
other web applications running on the same machine. Suppose the
machine's physical memory is 1GB and there are 3 web applications
running on it, I want to make sure that my application donot exceed
500MB.

My questions is this:
If I set <cache privateBytesLimit = "512000000" /in web.config file,
can my application's memory ever exceed 512000000 bytes (500MB) during
a Google crawl? I expect ASP.NET to do the following in case memory
exceed 500MB

1. Remove all expired cache items.
2. If memory still exceed 500MB, then remove non expired cache items
until memory fall back to 500MB.

Is this true or not?

Ningjun

Jan 22 '07 #3
Firstly, what does your application do that it requires 1/2 a gig of ram.
You realize that this is on the high side right? An applicaiton like this is
certainly not scalabe since 5 users will bring it to its knees, or worse,
crash the server.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
<ni**********@lexisnexis.comwrote in message
news:11*********************@q2g2000cwa.googlegrou ps.com...
>I need to worry about memory during a Google crawl because there are
other web applications running on the same machine. Suppose the
machine's physical memory is 1GB and there are 3 web applications
running on it, I want to make sure that my application donot exceed
500MB.

My questions is this:
If I set <cache privateBytesLimit = "512000000" /in web.config file,
can my application's memory ever exceed 512000000 bytes (500MB) during
a Google crawl? I expect ASP.NET to do the following in case memory
exceed 500MB

1. Remove all expired cache items.
2. If memory still exceed 500MB, then remove non expired cache items
until memory fall back to 500MB.

Is this true or not?

Ningjun

Jan 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
12
by: Jeremy | last post by:
Hi all, I'm getting very confused about how DB2 uses shared memory and I wonder if someone could clarify matters for me, please ? We are running 32bit DB2 V7.2 FP9 under AIX 4.3.3 on a machine...
22
by: xixi | last post by:
hi, we are using db2 udb v8.1 for windows, i have changed the buffer pool size to accommadate better performance, say size 200000, if i have multiple connection to the same database from...
4
by: xixi | last post by:
i have a very serious memory problem, we have db2 udb v8.1 load on a HP titanium machine with 4 G memory, it is 64bit machine, currently on DB2 instance , i have three databases, but only one is...
10
by: VM | last post by:
How can I limit the use of the PC's virtual memory? I'm running a process that basically takes a txt file and loads it to a datatable. The problem is that the file is over 400,000 lines long (77...
9
by: James Macbell | last post by:
I think I have pushed ASP.NET to the limit, I am not sure if I have done anything wrong in the code because I am trying to make 2 pieces of code (C# vs PHP) using the same algorithm. Anyways, here...
1
by: sunilkher | last post by:
Hi, here are the classes I have ... File chedCache.h #ifndef CHED_CACHE_INCLUDE #define CHED_CACHE_INCLUDE #include <map> #include "chedView.h"
2
by: D. Susman | last post by:
Hi, I know that this issue is indeed strictly operating system dependent but I am just curious: I have a five dimensional array, whose size sums to 68 MB (almost). This array is contained by...
5
by: =?windows-1256?B?5eTPx+bs?= | last post by:
Python allow you to only take care about variable name and ignore it's size because pyhton dynamicly allocate it so what's the limit in the allocated size in the memory
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.