Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

inetinfo.exe leak?

Posted on 2001-06-20
22
Medium Priority
?
625 Views
Last Modified: 2012-06-27
Setting: Windows 2000, IIS 5.0, ASP pages interacting with MS Access databases. Multiple (duplicate) applications written in MS VC++ populating the databases with remote data. These applications also call a third party COM object that sends data to a remote server. In all we have 20 directories containg 20 apps and the corressponding asp pages under the default web site.

Symptom: As the day progresses inetinfo.exe mem usage keeps growing as per Task Manager Is this normal behavior? Does it grow indefintely?. We have loaded the latest SP from Microsoft. I think memory becomes an issue because strange occurrences are witnessed. One occurrence includes the inability to resolve remote IP addresses, for example, the 3rd party COM object fails to connect to the remote server, Internet Explorer can't find common web sites, etc. On the other hand, the web pages remain accessible. Stop/start IIS (including inetinfo.exe) resolves the problem.

Where should I focus to determine the problem area (ASP pages, the applications themselves, IIS configuration)? Please advise.

0
Comment
Question by:domenic
  • 12
  • 5
  • 2
  • +3
22 Comments
 
LVL 2

Expert Comment

by:enkay022798
ID: 6211266
How about the CPU usage by inetinfo ? Does that show more than 0 even though there is no activity going on or is it only the memory that goes up ?
0
 
LVL 10

Expert Comment

by:makerp
ID: 6211304
this should not happern, no scalable server should consume memory without giving it back. eventually when all the page file is used up the machine will start complaining that its running low on virtual memory. i think your first port of call should be your 3rd party component. i can not see it being a problem with your 2000-IIS-MDB thing, unless of course the installation went wrong, maybe reinstall every thing if it persists
0
 
LVL 15

Expert Comment

by:liebrand
ID: 6211484
It may be a problem with the code, such as recordset not being closed properly, etc etc. Eventually you will eat up all the system resources if you do not close all your db connections properly.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:domenic
ID: 6211686
Thank you for the quick replies.
Enkay, CPU usage fluctuates for inetinfo since there is always activity during the day.

Makerp, I have contacted the third party concerning a leak with their COM object and they have no reported problems from other users. What part of the installation would I need to re-do?

Liebrand,
Doesn't ASP close the db connection automatically once you leave the page? Is there a way to detect current outstanding connections?
0
 
LVL 1

Author Comment

by:domenic
ID: 6211702
Thank you for the quick replies.
Enkay, CPU usage fluctuates for inetinfo since there is always activity during the day.

Makerp, I have contacted the third party concerning a leak with their COM object and they have no reported problems from other users. What part of the installation would I need to re-do?

Liebrand,
Doesn't ASP close the db connection automatically once you leave the page? Is there a way to detect current outstanding connections?
0
 
LVL 1

Author Comment

by:domenic
ID: 6211703
Thank you for the quick replies.
Enkay, CPU usage fluctuates for inetinfo since there is always activity during the day.

Makerp, I have contacted the third party concerning a leak with their COM object and they have no reported problems from other users. What part of the installation would I need to re-do?

Liebrand,
Doesn't ASP close the db connection automatically once you leave the page? Is there a way to detect current outstanding connections?
0
 
LVL 1

Author Comment

by:domenic
ID: 6211727
Thank you for the quick replies.
Enkay, CPU usage fluctuates for inetinfo since there is always activity during the day.

Makerp, I have contacted the third party concerning a leak with their COM object and they have no reported problems from other users. What part of the installation would I need to re-do?

Liebrand,
Doesn't ASP close the db connection automatically once you leave the page? Is there a way to detect current outstanding connections?
0
 
LVL 1

Author Comment

by:domenic
ID: 6211861
Thank you for the quick replies.
Enkay, CPU usage fluctuates for inetinfo since there is always activity during the day.

Makerp, I have contacted the third party concerning a leak with their COM object and they have no reported problems from other users. What part of the installation would I need to re-do?

Liebrand,
Doesn't ASP close the db connection automatically once you leave the page? Is there a way to detect current outstanding connections?
0
 
LVL 1

Author Comment

by:domenic
ID: 6211876
Thank you for the quick replies.
Enkay, CPU usage fluctuates for inetinfo since there is always activity during the day.

Makerp, I have contacted the third party concerning a leak with their COM object and they have no reported problems from other users. What part of the installation would I need to re-do?

Liebrand,
Doesn't ASP close the db connection automatically once you leave the page? Is there a way to detect current outstanding connections?
0
 
LVL 10

Expert Comment

by:makerp
ID: 6212046
em received load and clear :), if i missed the first post i was sure to catch the comment anyway :)

in my experience these problems are always down to dodgy installation, i would re-do the lot, windows up. the thing is people say user code but IIS should free resources when a script finsihes regardless of what the script never freed itself,

 
0
 
LVL 1

Author Comment

by:domenic
ID: 6212262
(I apologize for the multiple postings but I don't think I was responsible. EE hiccup?)
0
 
LVL 2

Expert Comment

by:kmv
ID: 6213025
I agree with makerp. IIS uses garbage collector (clear memory) when page finishes or variable code scope is finished (function internal variables frees when function finishes etc.) but it is better to close all recordsets and set them to nothing in your code. It is good programming style. Your code will be "symmetric": create object - use it - delete object.
Other point - third party components memory leaks. You can test components you uses. Create special page where you will create, work with component and release it, execute it in a separated thread and test this page. You can use special tools, e.g. MS web stress application but can use only your web browser.
Don't think that if nobody have reported problem to developers of COM component it doesn't mean that there is no such problem. I used one well-known library which has such bug (memory leak) but nobody told about it to developer of library. I fixed it myself because I had source code.
Create simple page and test it. If you really find bug and send report to developer with detailed description and source of your test files they possible fix it.

Best regards.
0
 
LVL 20

Expert Comment

by:Michel Sakr
ID: 6213170
It's all because of a bug in IIS4 and 5 obviously, this is the reason why session on end never fires or fires randomly in cases, it's called the Session_OnEnd bug although its directly related to random session timout read what you should do to avoid its side effects:

1-don't do any actions in the session on end since it never gets fired.. in most cases thus it will not be reliable
2- Don't EVER NEVER..EVER (I'll say it once more NEVEEEeeeR) store connections, large arrays, objects in session variables.. span a connection outside the boubdaries of a page..
3-and the most important: DON'T LEAVE A CONNECTION OPEN!! close all connections and clean them : Conn.close:Set Conn = nothing.. deinitialise also ALL created objects in scripts and components,  Set ObjName= nothing to free memory resources..

The problem is when you don't do one of the last 2 points.. the server resources are exauhsted (memory) and it crashes on a timely basis.. since the session data stays loaded in the memory..
(this bug was also detected in IIS5 but is a lot less frequent/ I'll say rare)  <-- you are one of these cases
0
 
LVL 1

Author Comment

by:domenic
ID: 6225321
I have taken the task of cleaning up my ASP pages. I was somewhat liberal with not closing my db connection, but I have included a "Conn.close Set Conn=nothing" at the end of every page. I performed some controlled tests on these new pages with the intention of collecting the private bytes used by inetinfo.exe using perfmon. I compared the results between the ASP pages with/without the changes. Inetinfo actually used more private bytes with my new ASP pages. There goes that. Nonetheless as kmv stated I will include these changes on the production machine because it is just 'good programming style'.

A Microsoft techie also suggested I free up my Session variables. I'm not quite sure if and how that would help. I use a Session variable as temporary data storage for a function call. I use the Session variables in one page only and then they are just disregarded. If I need the information again I recall the function to have them re-assigned.  Is this wasting memory significantly? I have noticed that the Session variables do expire quite rapidly and I did not expect that I needed to delete them somehow. Please comment on this.

The latest outcome happened this weekend. Activity on the web server is almost nil, but the problem occurred again while we were browsing around. The problem in question (as described in the first post) is that IP addresses are not resolved. Memory, it seemed, or lack of was not to blame. A call to Microsoft pointed us towards a new direction - MDAC. Apparently, there is several conflicting issues when we ran the Component Checker. Hence, tonight the MDAC 2.6 will be re-installed (you said it, makerp ;-)) and I will continue to monitor the situation.
0
 
LVL 20

Expert Comment

by:Michel Sakr
ID: 6226609
Session("NameOfVar") = ""  session objects should be deinitialised to free up memory resources.. I don't agree that when a script finishes it empties all the objects , session objects are there and won't unload because of the stated bug.. MDAC is the connection issue.. if you are closing your connection objects and cleaning them all should be fine on this side.. check what asp faq has to say about that:

http://www.aspfaq.com/faq/faqShow.asp?fid=66

http://www.aspfaq.com/faq/faqShow.asp?fid=7
0
 
LVL 1

Author Comment

by:domenic
ID: 6232035
Silvers5,

Thank you for the input. I do not use Session_onend in my global.asa. Furthermore, I have never seen any ASP code that performs this type of de-initialization where you set

Session( "my_var") = ""

Does this release the memory?
0
 
LVL 20

Expert Comment

by:Michel Sakr
ID: 6234025
yes.. especially if you are storin arrays.. the session timeout fires randomly.. and sometimes never fires.. this is directly "noticed" in the Session on end.. you may not be using it.. but your session is not timing out.. so the objects remains loaded in memory..

rgrds
0
 
LVL 1

Author Comment

by:domenic
ID: 6267707
Despite several tests, ASP modifications, and some dead-end recommendations from Microsoft (which caused further IIS crashes), I was able to duplicate (somewhat) the inetinfo.exe problem on my test machine which is set up identical to our production machine. After reviewing the IIS logs I did notice some consistency right before the problem arises. I do have some seldom used feature in an ASP page that uses a wrapper DLL written in VB6 (borrowed from Microsoft's KB) to the Internet Transfer Control class. This ASP code returns data from a web site using OpenUrl (HTTP), strips the HTML tags, and displays it on the client browser. It returns successfully every time, however, I've had it where it unexpectedly causes inetinfo.exe to become CPU bound and IIS no longer responds to http requests. Perusing the Microsoft support site I did come across some article denoting a bug with Inet.OpenUrl and FTP requests and how it causes inetinfo.exe to become CPU bound. They do suggest a workaround but I'm wondering if this explains the problem I was able to duplicate. The article seems to indicate that the problem is consistent in nature, unlike what I experience. Nonetheless I have disabled the feature and continue to monitor. I've read every article available in MS KB on the subject of ITC. What does experience dictate for the use of ITC in ASP?
0
 
LVL 20

Expert Comment

by:Michel Sakr
ID: 6279631
Hmm... Microsoft is unpredictable.. try to use other ways:

How do I read the contents of a remote web page?    
You can include static txt and HTML files from remote servers by using a component (such as AspHTTP (http://www.serverobjects.com/products.htm), ASPTear (http://www.alphasierrapapa.com/ComponentCenter/AspTear/), or VB's built in InetCtrls) to parse the remote URL's content.
 
You can also try this method out, it uses the MSXML objects which are installed with Windows 2000 (or you can download them here (http://download.microsoft.com/download/xml/Install/3.0/WIN98Me/EN-US/msxml3.exe) for other operating systems):
 
<%
    url = "http://www.espn.com/
    set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
    xmlhttp.open "GET", url, false
    xmlhttp.send "" 
    Response.write xmlhttp.responseText
%>

but you'll still need to clean the tags..

0
 
LVL 20

Accepted Solution

by:
Michel Sakr earned 900 total points
ID: 6279637
I guess tidy can do the job of cleaning.. didn't try it:

http://www.w3.org/People/Raggett/tidy/#help
0
 
LVL 1

Author Comment

by:domenic
ID: 6355965
Thank you for all the input. Summary: As of today the original problem still exists ( ...One occurrence includes the inability to resolve remote IP addresses, for example, the 3rd party COM object fails to connect to the remote server, Internet Explorer can't find common web sites, etc. ...) but the smoke has cleared so a better understanding of the problem has come about. It seems that the 3rd party COM object may be the culprit (not officially yet) and our focus has shifted toward dealing with the potential weakness of the COM object.
0
 
LVL 1

Author Comment

by:domenic
ID: 6355969
Thank you for all the input. Summary: As of today the original problem still exists ( ...One occurrence includes the inability to resolve remote IP addresses, for example, the 3rd party COM object fails to connect to the remote server, Internet Explorer can't find common web sites, etc. ...) but the smoke has cleared so a better understanding of the problem has come about. It seems that the 3rd party COM object may be the culprit (not officially yet) and our focus has shifted toward dealing with the potential weakness of the COM object.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question