Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Discussions > Troubleshooting > IE memory leak in latest JS code
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
calicardiff  
View profile  
 More options Jan 18 2008, 12:47 pm
From: calicardiff
Date: Fri, 18 Jan 2008 09:47:10 -0800 (PST)
Local: Fri, Jan 18 2008 12:47 pm
Subject: IE memory leak in latest JS code
We've just noticed that the latest ga.js code causes significant
memory leakage with both IE6 & IE7. I've used sIEve-0.0.8 to verify
this with an absolute basic HTML page that contains nothing but the
required JS code.

Has anyone seen anything similar or know what to do to prevent this as
obviously we can't use this on a large-scale production web site right
now?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Google Analytics memory leak test</title>
</head>
<body>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://
ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-
analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</body>
</html>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Jan 18 2008, 1:55 pm
From: ShoreTel
Date: Fri, 18 Jan 2008 10:55:15 -0800 (PST)
Local: Fri, Jan 18 2008 1:55 pm
Subject: Re: IE memory leak in latest JS code
Can you provide any more details? Which functions/arrays/variables are
causing the memory leak?

Out of curiosity have you tried stripping out the HTTP/HTTPS
autodetection and just using the proper version for your site (I know
I'm a broken record about that, but maybe document.write()'ing a
<script> tag causes a memory leak too). See here:
http://groups.google.com/group/analytics-help-troubleshoot/msg/e712ab...

If none of that helps, what if you keep the
<script type="text/javascript" src="http://www.google-analytics.com/
ga.js"></script>

but take out the
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
</script>

I wonder if it's inherent in the code, or if it only occurs during
execution.

On Jan 18, 9:47 am, calicardiff wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
calicardiff  
View profile  
 More options Jan 18 2008, 4:52 pm
From: calicardiff
Date: Fri, 18 Jan 2008 13:52:52 -0800 (PST)
Local: Fri, Jan 18 2008 4:52 pm
Subject: Re: IE memory leak in latest JS code
I tried your suggestion of replacing the document.write() with a
simple <script> include, however it still leaks memory.

The actual call that causes these memory leaks is the
"pageTracker._trackPageview();" one and it causes leaks in all
browsers (the Mac version of Safari with the Debug menu reports that
the web page has several objects still hanging around when it tries to
unload the page).

On Jan 18, 1:55 pm, ShoreTel wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
calicardiff  
View profile  
 More options Jan 18 2008, 5:12 pm
From: calicardiff
Date: Fri, 18 Jan 2008 14:12:41 -0800 (PST)
Local: Fri, Jan 18 2008 5:12 pm
Subject: Re: IE memory leak in latest JS code
Ah-ha solved it !

If you just put the JS code within an anonymous function then all
allocated memory objects get cleared correctly when the page is
unloaded as so:

<script type="text/javascript">
function() {
        var pageTracker = _gat._getTracker("UA-1107851-4");
        pageTracker._initData();
        pageTracker._trackPageview();

}

</script>

If any Google-type dev is reading this then I'd recommend updating the
basic cut-n-paste text to include this little addition.

On Jan 18, 4:52 pm, calicardiff wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
calicardiff  
View profile  
 More options Jan 18 2008, 5:37 pm
From: calicardiff
Date: Fri, 18 Jan 2008 14:37:03 -0800 (PST)
Local: Fri, Jan 18 2008 5:37 pm
Subject: Re: IE memory leak in latest JS code
Forget the last comment - I was getting ahead of myself and didn't
check the code correctly (it's been a long week) :(

On Jan 18, 5:12 pm, calicardiff wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
calicardiff  
View profile  
 More options Jan 18 2008, 5:51 pm
From: calicardiff
Date: Fri, 18 Jan 2008 14:51:33 -0800 (PST)
Local: Fri, Jan 18 2008 5:51 pm
Subject: Re: IE memory leak in latest JS code
The JS code should have been:

(function() {
        var pageTracker = _gat._getTracker("UA-1107851-4");
        pageTracker._initData();
        pageTracker._trackPageview();
        pageTracker = null;

})();

which doesn't make any difference in solving the memory leaks...

On Jan 18, 5:37 pm, calicardiff wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ShoreTel  
View profile  
 More options Jan 21 2008, 4:10 pm
From: ShoreTel
Date: Mon, 21 Jan 2008 13:10:43 -0800 (PST)
Local: Mon, Jan 21 2008 4:10 pm
Subject: Re: IE memory leak in latest JS code
That's very interesting. Can you determine what objects are hanging
around, or what functions inside of _trackPageview are leaking them?

On Jan 18, 2:51 pm, calicardiff wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »