I'm trying to clean up a large site that isn't formed too well. We started having memory problems about 2 months ago and they seem to be getting worse. The IT department had to restart the site this morning and it was using 1G of RAM. We watched it go up 30M in just 20 minutes. Something is using memory and not releasing it. We can't pinpoint where to start looking but I have a few suspects...
- session times are 4 hours and users may close a browser and start a new session before the old one is done. I've seen people who probably had 20 sessions running at once by doing this. But we rarely have more than 30 users at any given time so I doubt this is an issue. I might use 1k per session to hold session variables but it is probably less.
- I've found multiple instances in the code where connections are opened but not closed. The application connects to 3 databases.
- I think that the biggest culprit is probably recordsets that have not been set to "nothing". Can the data remain there where a new page is called? Do I need to set it to nothing before I reload it? For instance
Does anyone have any ideas as to what eats the most memory and is most reluctant to give it up?
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
- session times are 4 hours and users may close a browser and start a new session before the old one is done. I've seen people who probably had 20 sessions running at once by doing this. But we rarely have more than 30 users at any given time so I doubt this is an issue. I might use 1k per session to hold session variables but it is probably less.
- I've found multiple instances in the code where connections are opened but not closed. The application connects to 3 databases.
- I think that the biggest culprit is probably recordsets that have not been set to "nothing". Can the data remain there where a new page is called? Do I need to set it to nothing before I reload it? For instance
Code:
set cn = server.createObject("adodb.connection")
cn.open application("cnStr")
set rs = cn.execute("SELECT * FROM table1")
set rs = nothing [red]is this necessary? I never do this[/red]
set rs = cn.execute("SELECT * FROM table2")
response.redirect "someOtherPage.asp"
[red]Yes, I did that on purpose to show the bad form[/red]
set rs = nothing
cn.close
set cn = nothing
Does anyone have any ideas as to what eats the most memory and is most reluctant to give it up?
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook