Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Why does this function leak???

    Does this "leak"?

    Code:
       function touched() { 
       	/*var args = touched.arguments;
       	for(var i = 0; i < args.length; i++){
       		var obj = args[i];
       		if(!obj) continue;
       		if(!obj.id)
       		obj.id = getRandomId(); // give it an id
       		obj = null;
       	}
       	args = null;*/
       }
    I suspect you will get your "leak" from this since your return version did. If you do, I would conjecture that it is not a leak, or that you have tracked down the wrong function.
    Last edited by Trinithis; 04-30-2008 at 07:13 PM.
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by jaywhy13 View Post
    Btw.. I know it leaks since on page reload... memory isn't released. The app I'm building is a mapping one, it jumps by about 20-30 MB's on load up but on refresh stays in the same range (since it cuts by 20-30 then jumps up back by 2-30)... but once I dare pass a dom element in, it leaks!!!!
    that could be the cache not a leak sign, or something else.

    maybe this link will help:

    http://www.javascriptkit.com/javatut...ak/index.shtml

    regards

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Have you used Drip or sIEve to monitor the memory?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by A1ien51 View Post
    Have you used Drip or sIEve to monitor the memory?

    Eric
    Hmmm... never heard of these... gonna ask Google... brb.
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished

  • #5
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #6
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Welll... according to Sieve... I leak NOT!!!!!!!!!!
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •