Alexander,
Are you setting all unused objects to "unreachable"?
The GC doesn't know when an object is not being used in a running program
until you mark it as "unreachable".
In C# that's done with setting an object to null, in VB it's setting it to
nothing.
Of course if you have a Close() and/or a Dispose method you'd call that
first to make sure everything is cleaned up properly. I think on certian
objects in VB there might be something else to call, but bottom line is,
always clean up your objects before making them "unreachable" for the GC to
see it.
After cleaning up your objects the GC will at some point in time remove
those "unreachable" objects, unless you call GC yourself.
Are you setting your objects with an expiration (absolute/sliding), if so
are you setting the callback as well. In the callback once an item is
removed from cache you get the object passed to you. At that point in the
callback routine you'd again, Close()/Dispose() and set to "unreachable", or
you can even put it back in the cache too.
Remember, the GC will not touch any object until you mark it as
"unreachable".
[quoted text, click to view] "Alexander Inochkin" <alex_i@community.nospam> wrote in message
news:OMPWGZLQFHA.3716@TK2MSFTNGP14.phx.gbl...
> OK. I can set Memory recycling for my application. It will restart
> application. But I do not need to restart one.
> I need to remove (flush) old cache entries when low memory occured.
>
> I notice, application works correctly on the windows server 2003 system
> with 1Gb RAM.
> How it happens? I insert new objects in the cache. Application use more
> and more of memory.
> Some point some cached objects removed from cache without any errors. It
> is normal. (In my application I can control count
> cached objects.)
>
> But on the system with 2 Gb RAM (!!!) the application raises exception
> OutOfMemoryException and does not remove (flush)
> old cached objects!!!
>
> Cache work incorrect on the system with larger memory!!!
> Why the .NET does not remove (flush) the old objects from cache in this
> case?
>
>
>> Hello Alexander,
>>
>> How did you set the Memory recycling for the application pool? If your
>> ASP.NET consume too much memory, a recycling is reqiured. Also, I suggest
>> you may consider reduce the life time (its expire property) of cached
>> object so that it won't cost too much of memory.
>>
>> Luke
>>
>
>