The static objects of the web service are swapped out.

C

cycheng

I write a web service which holds a static hashtable
At the first method invocation, the constructor loads the hashtable
then the look-up method of the web service can run quickly by look up
the pre-loaded hashtable
My question is, if the web service has not called for a period of the time
the memory used by the hashtable seems to be swap out
Then the look-up method will take a long time
It is even longer than the time to load the whole hashtable
I want to emphasize that the web serivce does not be recycled
I have the log code to show the constructor does not called again
Anyone has the solution
 
M

Mickey Williams

What version of IIS are you running? In IIS 6, by default applications are
configured to shut down after a specified time period. If your application
is unloaded, then all of your static instances will be reloaded. Depending
on static instances in a web service is a problem in the general case - in
ideal scenarios a web service should be able to be restarted at any time.
Can you back that data up in a database?
 

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,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top