I am using a static dictionary to objects (like cache) but woundered
if it is better to use cache.
Which one would should I use? 6 7221
It depends on what you need ;-p
Most importantly, most cache implementations will provide thread
safety, which a static dictionary (by itself) doesn't - you'd need to
do your own synchronization. But cache implementations may also offer
options for lifetime, dependencies (file system, etc), serialization,
etc.
Marc
Where you use this,
It makes a big difference by instance if it is in
A web application
A forms application
A service application
And that is then the start.
Cor
<Pa*************@gmail.comschreef in bericht
news:c7**********************************@1g2000pr g.googlegroups.com...
>I am using a static dictionary to objects (like cache) but woundered
if it is better to use cache.
Which one would should I use?
Where you use this,
[web/forms/service]
My understanding is that it *used* to make a lot more difference,
since without "web" it didn't fire up a thread to recover the memory -
but I thought that was now fixed, allowing you to use the cache from
System.Web in any scenario? Correct me if I am wrong...
And of course that is just the System.Web cache; most implementations
are architecture neutral / agnostic.
Marc
On May 18, 5:41*pm, Marc Gravell <marc.grav...@gmail.comwrote:
Where you use this,
[web/forms/service]
My understanding is that it *used* to make a lot more difference,
since without "web" it didn't fire up a thread to recover the memory -
but I thought that was now fixed, allowing you to use the cache from
System.Web in any scenario? Correct me if I am wrong...
And of course that is just the System.Web cache; most implementations
are architecture neutral / agnostic.
Marc
Hi thank you for that.
I am using a Web application. The reason why I am asking this
question is the memory usage, as currently we are getting out of
memory errors, though these dictionary objects only take 27 meg of
memory, would putting these into Cache would be better from a memory
point of view?
Well, the cache is likely to have more sophisticated scavenging
rules... but this isn't a great help if your code detects the missing
cache data and simply re-fetches it.
If you are getting memory errors, I'd first want to understand where
all the memory has gone, with profiling tools (the inbuilt performance
counters are the first thing to look at - what is the memory graph
like? a diagonal line is never good...) Pa*************@gmail.com wrote:
Hi thank you for that.
I am using a Web application. The reason why I am asking this
question is the memory usage, as currently we are getting out of
memory errors, though these dictionary objects only take 27 meg of
memory, would putting these into Cache would be better from a memory
point of view?
27 MB of memory *per* dictionary, or 27MB of memory *for all* dicionaries?
If it's per dictionary, then it wouldn't take too much to overload a server with
even 4GB+ of RAM (assuming a single sesssion consumes only the 27MB in the
cache, it's roughly 148 sessions to eat 4GB).
That's a lot of memory to consume either way. What are you storing in it?
Chris. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Zombie |
last post by:
Hi, what is the correct way of converting contents of a <string> to
lowercase?
There are no methods of <string> class to do this so I fallback on
strlwr().
But the c_str() method returns a const...
|
by: Joanna Carter \(TeamB\) |
last post by:
I would like to copy the contents of a Dictionary<string, object> to another
Dictionary<string, object>. Do I have to iterate the source use something
like foreach or is there an easier way ?
...
|
by: Wilson |
last post by:
Hi,
How do get the Dictioanry object from FiedlInfo ?
my code :
fieldInfo = this.GetType().GetField("dictioanry1");
??Dictionary<string, string> dicTemp1 = (Dictionary<string,...
|
by: buzzweetman |
last post by:
Many times I have a Dictionary<string, SomeTypeand need to get the
list of keys out of it as a List<string>, to pass to a another method
that expects a List<string>.
I often do the following:
...
|
by: Mark Rae |
last post by:
Hi,
Is it possible to create a case-insensitive List<stringcollection?
E.g.
List<stringMyList = new List<string>;
MyList.Add("MyString");
So that:
|
by: Mark S. |
last post by:
Hello,
The app in question is lives on a Windows 2003 server with .NET 2.0 running
IIS 6. The page of the app in question processes 2000 get requests a second
during peak loads.
The app uses...
|
by: Assimalyst |
last post by:
Hi
I have a Dictionary<string, List<string>>, which i have successfully
filled. My problem is I need to create a filter expression using all
possible permutations of its contents.
i.e. the...
|
by: Andy B |
last post by:
Is there a way to databind a checkBoxList to a Dictionary<string, string>
object? If so, how do you do it?
|
by: Andy B |
last post by:
I don't know if this is even working or not but here is the problem. I have
a gridview that I databound to a dictionary<string, stringcollection:
Contract StockContract = new Contract();...
|
by: jandeerit |
last post by:
hi...
can anyone help to show me how to store the array in a dictionary object as shown below?
FROM: Array
: "PARAMETERS"
: "ParamName-1"
: "ParamValue-1"
: "ParamName-2"
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| | |