Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Memory leak in IE javascript with webservice.htc

Reply
Thread Tools

Memory leak in IE javascript with webservice.htc

 
 
Chris Bardon
Guest
Posts: n/a
 
      09-27-2004
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>
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      09-27-2004
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" <> wrote in message
news: ...
> 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>



 
Reply With Quote
 
 
 
 
Gabe Garza
Guest
Posts: n/a
 
      09-27-2004
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" <> wrote in message
news: ...
> 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>



 
Reply With Quote
 
Gabe Garza
Guest
Posts: n/a
 
      09-27-2004
Opps, meant to say until the OS runs out of memory.

"Gabe Garza" <> wrote in message
news:4k%5d.20491$ 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" <> wrote in message
> news: ...
> > 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>

>
>



 
Reply With Quote
 
Chris Bardon
Guest
Posts: n/a
 
      09-28-2004
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" <> wrote in message news:<>...
> 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)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leak even after deleting memory pointers from vector cham C++ 5 09-25-2008 10:30 AM
Leak or no leak ?? Richard Heathfield C Programming 4 07-10-2006 11:37 AM
Dynamic memory allocation and memory leak... s.subbarayan C Programming 10 03-22-2005 02:48 PM
Memory leak??? (top reporting high memory usage under Solaris) Mark Probert Ruby 4 02-09-2005 06:13 PM
Memory leak in IE javascript with webservice.htc Chris Bardon ASP .Net 4 09-28-2004 12:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57