queries and memory consumption

i am executing a large query to return several thousands of rows of data.  in sql query analyzer, the query runs for 3 minutes without using much memory.

i am writing an page that executes the same query in a stored procedure on the server.  when i do this. aspnet_wp.exe gets huge in a hurry, and eventually crashes from too much memory usage.  what can i do with asp/ to not use very much RAM?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

its depends on how you do it....if you keep the data into dataset... yes, it will consume the memory space.

if you are planning to get the data for reporting (example only), you should just use datareader instead. dump the data directly out to the client without delay will save you memory.

response.buffer = false <-- this will not store anything in the memory when constructing the page.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Try one of following (or all), it should help:
1. Make sure you close Sql connection (connObject.Close())
2.  <a href="">Download IIS 5.0 Process Recycling Tool</href>
3. Set limit to wp memory consumption:<processModel>memoryLimit = 60
4. Upgrading to windows 2003 will solve your problem because by default it doesn't uses aspnet_wp.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.