WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Process ID

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Memory Leak Using tGetdat on Web Service Counter


Question:

How can I find the memory leak in my script. I think the problem I'm having is with tGetdata because since I have put this command in my script it now leaks. Here is some code that gives me a memory leak.
;Addextender("wproc34i.dll")
Addextender("wwprc44i.dll")
WBcounterstring="\Web Service(_Total)\Current Anonymous Users"
BoxOpen(WBcounterstring, "Initializing")
While @true
	WBintdat=tGetData(WBcounterstring,0)
	BoxText(WBintdat)
	TimeDelay(1)
        Drop (wbintdat)
Endwhile

Details:

  • Script is run as a service
  • Process Extender version 10012
  • Windows 2000 SP4
  • IIS 5.0

Answer:

You mentioned you were running the script as a service. By defaultservices are generally run under the 'local system' account, if not specified otherwise.

There seems to be a known issue with memory leaks in IIS 5.0 due to not running under an adminstrative account. http://support.microsoft.com/default.aspx?kbid=274591

NOTE: There are no known issues with tGetData having a memory leak. The leak could be caused by either a leak in the API's on the platform you were running it on (Windows 2000) or due to a leak in the counter installed by IIS. Its difficult to say for sure. Check with the manufacturer of that counter (In this case IIS - Microsoft) to see if there are any hotfixes or updates that might apply.

To check to make sure the memory leak is actually due to the 'Web Service' performance counter:

Apparently, MS offers a utility that can help track down memory leaks in performance counters. If you interested here is a link to that utility:
http://support.microsoft.com/default.aspx?scid=kb;en-us;296794

User reply:

Ok I found that when I add that IIS counter to the Performance monitor the smlogsvc.exe leaks! :(

Answer:

That what I suspected. There *might* be something wrong with that counter. Please see: http://support.microsoft.com/default.aspx?scid=kb;en-us;273653

As a work around: Maybe have the service script launch (RunWait) a secondary script that calls tGetData for the counter then exits each time????

Or you could have the script monitor its Mem Usage, and if it goes abouve some predefined value then have it relaunch itself. Here is some code that can monitor the 'Mem Usage' in KB.

;Addextender("wproc34i.dll")
Addextender("wwprc44i.dll")
WBcounterstring="\Process(checkweb4u.exs)\Working Set"

BoxOpen(WBcounterstring, "Initializing")
While @true
	WBintdat=tGetData(WBcounterstring,0)
	BoxText(WBintdat/1024)  ;convert to kilobytes
	TimeDelay(1)
Endwhile
exit

Article ID:   W15861
File Created: 2017:07:28:13:58:39
Last Updated: 2013:04:01:09:10:41