/    Sign up×
Community /Pin to ProfileBookmark

Weird Javascript Object Bug?

I’m trying to make an AJAX site that makes heavy use of objects (maybe
my first mistake =( …). I’ve come across a bizarre bug when using IE
6 where objects don’t seem to go away after leaving a page! Any help, insight (solution =P ) or empathy is greatly appreciated!

At first I thought it was some sort of memory leak [closures or circular references] … but I diagnosed with drip [and it came up clean]. Also, it doesn’t seem to be related to IE caching (since even with my IE6 caching turned off, I still have the problem).

An example of it is below:

[url]http://www.geocities.com/arvindsagarwal/test.htm[/url]

To replicate the bug, go to the site, press refresh (or F5) multiple times. At each refresh, it appears that the objects take longer to create!… For test 1 through 3, the times stay generally consistent. However, for test, 4 and 5, each refresh adds about 10-20 ms! Strangely (or expectedly), it doesn’t cause problems in any version of Firefox or IE7. I’d ignore the problem, but it appears ~30% of users are still using IE6 [and it would be a fallacy to ignore them]. Any help would be greatly appreciated… as its driving me crazy!

This is what I see:
————————————————————————————-

1st Refresh:

1) Create 10000 Objects took 63ms
2) Create 10000 Objects Second Time took 47ms

3) Making Collection of 10000 objects took 109ms

4) Create 10000 Objects after creation of collection took 187ms
5) Create 10000 Objects second time after creation of collection took 188ms

6) Creating 10000 objects after destroying the collection took 94ms
7) Creating 10000 objects second time after destroying the collection took 47ms


————————————————————————————-

7th Refresh:

1) Create 10000 Objects took 62ms
2) Create 10000 Objects Second Time took 63ms

3) Making Collection of 10000 objects took 156ms

4) Create 10000 Objects after creation of collection took 390ms <– ??????
5) Create 10000 Objects second time after creation of collection took 360ms

6) Creating 10000 objects after destroying the collection took 109ms
7) Creating 10000 objects second time after destroying the collection took 47ms

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Jeff_MottSep 06.2008 — I opened your test page in IE6, and I refreshed and refreshed and refreshed and refreshed, but I couldn't reproduce your results.
Copy linkTweet thisAlerts:
@DokSep 07.2008 — Here are my results. They stay the same no matter how many times I refresh using IE 6 (MultipleIE) on Win XP SP 3

1) Create 10000 Objects took 31ms

2) Create 10000 Objects Second Time took 47ms

3) Making Collection of 10000 objects took 94ms

4) Create 10000 Objects after creation of collection took 125ms

5) Create 10000 Objects second time after creation of collection took 109ms

6) Creating 10000 objects after destroying the collection took 62ms

7) Creating 10000 objects second time after destroying the collection took 47ms
Copy linkTweet thisAlerts:
@cgishackSep 07.2008 — Here are my IE6 results. They generally stay the same each time +/- 5 ms

1) Create 10000 Objects took 172ms

2) Create 10000 Objects Second Time took 187ms

3) Making Collection of 10000 objects took 500ms

4) Create 10000 Objects after creation of collection took 484ms

5) Create 10000 Objects second time after creation of collection took 485ms

6) Creating 10000 objects after destroying the collection took 219ms

7) Creating 10000 objects second time after destroying the collection took 156ms


My firefox results are way better though.. Nothing under 11 ms
×

Success!

Help @sulinbear spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...