473,466 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Memory leak in IE javascript with webservice.htc

I'm working on an application where I need to be able to call a .net
web service from javascript. I found the webservice.htc file, and was
able to create a page that worked just fine, except that the memory
usage of iexplore.exe began to increase without limit as the service
was called. To demonstrate this, I tried the following script, which
showed the increase very quickly by continuously calling the service.
Since useService is the only method being called, this is likely where
the problem lies. Is there a fix for this problem yet?

Thanks,

Chris
<html>
<head>
<script language="JavaScript">

function init()
{
service.useService("http://testServer/testcti/service1.asmx?WSDL","Test");
call();
}

function call()
{
service.TestCTI.callService("AgentEventWait",1000, 100,"ice1");
}

function onWSresult()
{
call();
}
</script>
</head>
<body onload="init()">
<div id="service" style="behavior:url(webservice.htc)"
onresult="onWSresult()">
</div>
</body>
</html>
Nov 18 '05 #1
4 2377
IE has lots of memory leaks, not surprising that that there is a leak
calling xmlhttp. I doubt that any fix will be coming, as the soap behavior
calls for increased security settings with xp-sp2. switch to the standard
hidden frame approach for IE, and save soap calls for mozilla/netscape which
have it in.

-- bruce (sqlwork.com)
"Chris Bardon" <cm******@engmail.uwaterloo.ca> wrote in message
news:5c************************@posting.google.com ...
I'm working on an application where I need to be able to call a .net
web service from javascript. I found the webservice.htc file, and was
able to create a page that worked just fine, except that the memory
usage of iexplore.exe began to increase without limit as the service
was called. To demonstrate this, I tried the following script, which
showed the increase very quickly by continuously calling the service.
Since useService is the only method being called, this is likely where
the problem lies. Is there a fix for this problem yet?

Thanks,

Chris
<html>
<head>
<script language="JavaScript">

function init()
{
service.useService("http://testServer/testcti/service1.asmx?WSDL","Test");
call();
}

function call()
{
service.TestCTI.callService("AgentEventWait",1000, 100,"ice1");
}

function onWSresult()
{
call();
}
</script>
</head>
<body onload="init()">
<div id="service" style="behavior:url(webservice.htc)"
onresult="onWSresult()">
</div>
</body>
</html>

Nov 18 '05 #2
Chris,

You've setup call() to call itself until run IE runs out of memory.
'onresult' is for checking the result of a callService().
In your 'onWSresult()' Javascript function don't call call(), check for the
following

function onWSresult()
{
if((event.result.error)&&(iCallID==event.result.id ))
{
var xfaultcode = event.result.errorDetail.code;
var xfaultstring = event.result.errorDetail.string;
var xfaultsoap = event.result.errorDetail.raw;

// Add code to output error information here
alert("Error ");
}
}

The way you have it now

function onWSresult()
{
call();
}

onWSresult() calls call() over and over again because you've setup a
onresult to fire an event after AgentEventWait is finished.

Once the first call() is finished, which is your call to your
AgentEventWait, that's when your onresult event gets fired, which is your
onWSresult() function.
onWSresult() calls call() again, once that call is finished, again your
AgentEventWait, then that's when your onresult event gets fired again, which
is your onWSresult().

To verify that this is the case, use DbgCLR.exe and set a breakpoint inside
of AgentEventWait, then call your HTML page that calls the webservice.
You'll see AgentEventWait being called again and again.

Gabe
"Chris Bardon" <cm******@engmail.uwaterloo.ca> wrote in message
news:5c************************@posting.google.com ...
I'm working on an application where I need to be able to call a .net
web service from javascript. I found the webservice.htc file, and was
able to create a page that worked just fine, except that the memory
usage of iexplore.exe began to increase without limit as the service
was called. To demonstrate this, I tried the following script, which
showed the increase very quickly by continuously calling the service.
Since useService is the only method being called, this is likely where
the problem lies. Is there a fix for this problem yet?

Thanks,

Chris
<html>
<head>
<script language="JavaScript">

function init()
{
service.useService("http://testServer/testcti/service1.asmx?WSDL","Test");
call();
}

function call()
{
service.TestCTI.callService("AgentEventWait",1000, 100,"ice1");
}

function onWSresult()
{
call();
}
</script>
</head>
<body onload="init()">
<div id="service" style="behavior:url(webservice.htc)"
onresult="onWSresult()">
</div>
</body>
</html>

Nov 18 '05 #3
Opps, meant to say until the OS runs out of memory.

"Gabe Garza" <sp**@nospam.com> wrote in message
news:4k******************@newssvr21.news.prodigy.c om...
Chris,

You've setup call() to call itself until run IE runs out of memory.
'onresult' is for checking the result of a callService().
In your 'onWSresult()' Javascript function don't call call(), check for the following

function onWSresult()
{
if((event.result.error)&&(iCallID==event.result.id ))
{
var xfaultcode = event.result.errorDetail.code;
var xfaultstring = event.result.errorDetail.string;
var xfaultsoap = event.result.errorDetail.raw;

// Add code to output error information here
alert("Error ");
}
}

The way you have it now

function onWSresult()
{
call();
}

onWSresult() calls call() over and over again because you've setup a
onresult to fire an event after AgentEventWait is finished.

Once the first call() is finished, which is your call to your
AgentEventWait, that's when your onresult event gets fired, which is your
onWSresult() function.
onWSresult() calls call() again, once that call is finished, again your
AgentEventWait, then that's when your onresult event gets fired again, which is your onWSresult().

To verify that this is the case, use DbgCLR.exe and set a breakpoint inside of AgentEventWait, then call your HTML page that calls the webservice.
You'll see AgentEventWait being called again and again.

Gabe
"Chris Bardon" <cm******@engmail.uwaterloo.ca> wrote in message
news:5c************************@posting.google.com ...
I'm working on an application where I need to be able to call a .net
web service from javascript. I found the webservice.htc file, and was
able to create a page that worked just fine, except that the memory
usage of iexplore.exe began to increase without limit as the service
was called. To demonstrate this, I tried the following script, which
showed the increase very quickly by continuously calling the service.
Since useService is the only method being called, this is likely where
the problem lies. Is there a fix for this problem yet?

Thanks,

Chris
<html>
<head>
<script language="JavaScript">

function init()
{
service.useService("http://testServer/testcti/service1.asmx?WSDL","Test"); call();
}

function call()
{
service.TestCTI.callService("AgentEventWait",1000, 100,"ice1");
}

function onWSresult()
{
call();
}
</script>
</head>
<body onload="init()">
<div id="service" style="behavior:url(webservice.htc)"
onresult="onWSresult()">
</div>
</body>
</html>


Nov 18 '05 #4
Thanks Bruce-is there somewhere that details this "hidden frame"
approach that you're talking about? I tried a version where I had a
frame invoking the web service using an HTTP GET call and the page's
location property, but there was no way that I could get the returned
XML to the main frame without an access violaton. Since the web
service call that I'm making can block, I can't really use the auto
refresh property to perpetually call it. Ideally, I'd like to be able
to do what I had in my script, which is to call the service, handle
the return, then call it again. Any idea how I can accomplish this?

"bruce barker" <no***********@safeco.com> wrote in message news:<uu*************@TK2MSFTNGP14.phx.gbl>...
IE has lots of memory leaks, not surprising that that there is a leak
calling xmlhttp. I doubt that any fix will be coming, as the soap behavior
calls for increased security settings with xp-sp2. switch to the standard
hidden frame approach for IE, and save soap calls for mozilla/netscape which
have it in.

-- bruce (sqlwork.com)

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Emmanuel Gehin | last post by:
When I use the following code in VB.NET : Public Function test() As String Try Dim da1 As OdbcDataAdapter Dim i As Int32 Dim tfem As DataTable For i = 0 To 1000 da1 = New...
8
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
8
by: BillE | last post by:
I have an existing asp.net 2.0 webforms app using master/content pages, and it works fine. I added some Ajax elements, including some UpdatePanels and modal PopUp panels which contain asp.net...
1
by: cdmsenthil | last post by:
I have an Infragistics UltrawebGrid . Each Row in the grid is attached to a context menu using Infragistics CSOM Upon click on the menu, I am creating an Iframe dynamically which points to...
2
by: Jay | last post by:
I have a web app running on the windows CE device. In one of the asp.net pages - it has javascript code. That seems to have a memory leak. When I run the web app - in about one hour, the app hangs....
1
by: Daniel S | last post by:
Hi, I have an asp.net page with a GridEX inside an UpdatePanel. Every 20 seconds, I need to re-submit a query to the database and refresh the GridEX with the new results; however, each time...
18
by: Daniel Orner | last post by:
Hi all, I've been trying to pin down a memory leak in IE6 for several WEEKS now. I've done my share of googling etc., and know all about common leaks like circular references and closures, but...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.