Reclaiming asp.net memory

  • Thread starter Thread starter Alvin Bruney
  • Start date Start date
A

Alvin Bruney

Interesting problem here.
Asp.net does not immediately give back its memory. How can i force it to
give back this memory? I thought of having a scheduled low priority thread
running in the background for my app, cleaning unused static objects and
possibly calling the garbage collector manually. I don't really like this
idea of mucking with the GC but would that be a feasible approach? I'm
worried because I see my memory climbing constantly especially after I have
pulled a dataset with about 150,000 rows of data. I'm careful to null out
the dataset, but that memory stays allocated to the aspnet worker process
and it refuses to give it back.

The app is running IIS5 so I don't really have the ability to manually
recycle the application pool without affecting everything running on the
box. I thought of using the machine config file to recycle the worker
process when memory passes a certain limit, but i reject this approach
because it flushes my static variables with the application restart and
logged in users get bumped off loosing their valuable data. I'd like the
aspnet worker process to give back a chunk of memory in a friendly way
without restarting the application.

What i wanted to do, but this kept failing was use the processModel in
web.config file to set session idle times, but that tag in the webconfig
file is not allowed, only in the machine config file

Any ideas? Anything i've missed?
 
Back
Top