I have a classic ASP CRM that was created by a third-party company. Currently, I have access to the source code and I can make any changes.
By chance during the day, usually after some prolonged use by users, most of my pages begin to receive a "Out of Memory" error.
As the application is created, all pages and scripts pull the main functions from the Global.asp file. Other global files are also embedded in this file, but the error presented shows
From memory
WhateverScriptYouTriedToRun.asp String 0
Line 0 is the include for the global.asp file. As soon as an error occurs, after an indefinite period of time, the occurrence of the error subsides for a while, and then begins to repeat again. With how the application is written and what functions it uses, and the “diagnostics” that I have already done, it seems to be the usual function used that holds data, such as a set of records or something like that, and then does not release it properly, then other users try to use the same function, and in the end it just fills up, causing an error. The only way to resolve the error effectively is to actually restart IIS, recycle the application pool, and restart SQL Server services.
Needless to say, me and my users are annoyed ....
I can’t pinpoint the error due to the actual error message, which is line 0, but from there I have no idea where in the 20 kilogram lines of code it can hang itself. Any thoughts or ideas on how to isolate, or at least point me in the right direction, to start clearing it? Is there a way to increase memory size for VBScript? I know there is a limit, but is it set ... 512K and can you increase it to 1 GB?
Here is what I tried:
- Removing SQL Inline Statements in Views
- Passing several hundreds of scripts and ensuring that each OpenConnection and OpenRecordSet are matched with the corresponding closure.
- Going through a global file and commenting out any large SQL statements, such as ApplicationLog (a function that writes a executed query to a table).
- Some smaller script changes.