Optimizing memory/CPU usage

FLEXX

New member
Joined
Dec 28, 2004
Messages
2
Programming Experience
3-5
I'm modifying a Web service written by a previous co-worker in order to optimize memory usage. We encountered severe problems a couple of weeks ago on our Web server (out of memory exception errors). We currently have 3 Web services running under IIS 5.0 on this server so now we are in the process of modifying the code in order to optimize the memory. I've noticed that this co-worker instantiated a large number of objects (using the Dim New keywords) within For Loops and While Loops. Instead of Dimming inside the conditional statements, I moved the code outside the loops and Dim New once, resusing the same variables each time through the loops. However, this caused my aspnet_wp.exe (worker process) to recycle itself because the memory consumption exceeded that which was configured under IIS. I thought that I could Dim New a reference variable once and reuse it as long as it was still in scope. Does anyone know why this seems to have consumed more memory than when the reference variables were Dimmed New each time through the loops? Thank you in advance for your help.
 
Back
Top