473,729 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE memory leak, how to resolve?

rizwan6feb
108 New Member
I am working on an ajax chat application, done most of the work but when i tested it on IE (both on IE6 and IE7), found that there is a memory leak. The application works fine on FF. How can i fix this?

I have used ajax in the following way (this is a similar to how i am using ajax in my chat application); incrementer.php file on line # 34 simply prints an incremented value from the session

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script language="javascript">
  4.     function getAjaxObject(){
  5.         try{
  6.             ajaxRequest = new XMLHttpRequest();
  7.         } catch (e){
  8.             // Internet Explorer Browsers
  9.             try{
  10.                 ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
  11.             } catch (e) {
  12.                 try{
  13.                     ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
  14.                 } catch (e){
  15.                     // Something went wrong
  16.                     alert("Your browser doesn't support ajax!");
  17.                     return false;
  18.                 }
  19.             }
  20.         }
  21.         return ajaxRequest;    
  22.     }
  23.     function startCounting(){
  24.         var a=getAjaxObject();
  25.         a.onreadystatechange = function(){
  26.             if(a.readyState==4){
  27.                 var text=a.responseText;
  28.                 var e=document.getElementById('val');
  29.                 if(e){
  30.                     e.innerHTML=text;
  31.                 }
  32.             }
  33.         }
  34.         a.open("GET", "incrementer.php", true);
  35.         a.send(null);
  36.         setTimeout(startCounting,1);
  37.     }
  38. </script>
  39. </head>
  40.  
  41. <body>
  42.     <input type="button" value="Send Object" onclick="startCounting()" />
  43.     <div id="val">    </div>
  44. </body>
  45. </html>
  46.  
  47.  
Sep 5 '08
10 2591
acoder
16,027 Recognized Expert Moderator MVP
So simple that I didn't think of. Thanks rnd me ;)
Sep 8 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4670
by: Jeremy Lemaire | last post by:
Hello, I am working on cross platform code that is displaying a huge memory leak when compiled on 11.00 HPUX using the aCC -AA flag. It is not leaking on NT, LINUX, Solaris, or HPUX without the -AA flag. In another news group I came across some interesting (ok scarey) information regarding memory leaks in the STL list<...> container. I have compiled and executed the following code and verified that this does in fact leak on my system.
1
6724
by: M. Oakley | last post by:
We are using ODBC connection pooling with SQL Server 2000 v5 on Win 2000 v5 sp4. Each time we get a connection, SQLConnect, we see the memory usage go up, about 52K. When we return the connection to the pool, SQLDisconnect, and after the time that the connection remains in pool expires we see the memory usage drop by about 28K. Our basic steps for a select are: SQLAllocHandle(SQL_HANDLE_DBC, hGblEnv, &hdbc);
10
14091
by: Matt Kruse | last post by:
I'm aware of the circular reference memory leak problem with IE/closures. I'm not sure exactly how to resolve it in this situation. Also, Firefox appears to grow its memory size with the same code. So I'm wondering if I'm missing something? My test code is as follows: function myObj() { var req = new Object(); req.temp = 0;
19
1737
by: Jon Davis | last post by:
I'm reposting this because I really need some advice. I have a web app that makes many queries to the database on every page. In order to save development effort, I've consolidated all database querying to methods in a single static class, so whenever I need data, I pass a SQL string to a method and I am passed a datareader or else individual values (string, integer, etc). There is a horrible memory leak in this application. Just one...
7
1699
by: bill | last post by:
Does the following constitute a memory leak? int main(int ac, char **av) { char *buf; while(1) { buf = malloc(BIG_NUMBER); execv(av, av); }}
7
2556
by: Fernando Barsoba | last post by:
Hi, After following the advice received in this list, I have isolated the memory leak problem I am having. I am also using MEMWATCH and I think it is working properly. The program does some calculations and stores elements in a list. After that, a sorting algorithm is used over that list. Two functions are called before the sorting process:
94
4750
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring that I found inside of a string. Any ideas?
2
1735
by: rizjabbar | last post by:
I have a memory leak happening... I believe it is due to Dom parser... could anyone help me with this: Do I need a delete??? /////////////////////////////////////////////// //Code on Main HTML page: <html> <head> <SCRIPT LANGUAGE="JavaScript" SRC="Engine.js" ></SCRIPT> <SCRIPT LANGUAGE="JavaScript" SRC="Sarissa.js" </SCRIPT> </head>
22
2272
by: Frank Rizzo | last post by:
I have an object tree that is pretty gigantic and it holds about 100mb of data. When I set the top object to null, I expect that the .NET framework will clean up the memory at some point. However, I am looking at the Task Manager and I don't see the MemUsage column decreasing even after an hour or two. I know that TaskManager may not be the best place to see what is the true way to gauge memory usage and/or presense of memory leaks. So...
13
4350
by: Pep | last post by:
I have recently eradicated a lot of memory leaks in a very old C++ source set. However, whilst they were all fairly easy to resolve, I am confused by the last one. This seems to be related to throwing a std::exception with a string object. This is the test program ============================================================================= #include <sstream> #include <iostream>
0
9284
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9202
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9148
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4528
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.