473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 privateBytesLim it = "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 5608
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**********@l exisnexis.comwr ote in message
news:11******** **************@ v45g2000cwv.goo glegroups.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 privateBytesLim it = "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 privateBytesLim it = "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**********@l exisnexis.comwr ote in message
news:11******** *************@q 2g2000cwa.googl egroups.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 privateBytesLim it = "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
2035
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 the thread is over a month old, I decided to start a new one with my response. Please see my comments inline.
12
5514
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 with 64 Gb of memory with a single non-partitioned database using extended storage and with intra-parallelism enabled. I've been experimenting...
22
3450
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 application server, will each connection take the memory 800M (200000 x 4k = 800 M), so the memory took will be 800M times number of connections, or the...
4
5186
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 being used, on the same machine, i have an application server running connect to this DB2 server, every day there are around 12 persons has connection...
10
3784
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 MB) and after a while I get the Windows message saying that the virtual memory's getting really low. Plus the machine gets really sluggish (with...
9
1717
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 is the my test. How: Create a HTML page with 2 hyper links to these files (posted below). Right click, Save target As. Tested: On my P4 1.6 GHz...
1
1678
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
3212
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 class X. When I simply attempt to create an instance of that class, I get segmentation fault. I am working on Solaris (which has 8 KB pages )....
5
13554
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
7532
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7461
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7491
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1068
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.