Results 1 to 6 of 6

Thread: Problem With jsDOMenubar - Memory Leak in IE

  1. #1
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Problem With jsDOMenubar - Memory Leak in IE

    1) Script Title: jsDOMenubar

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...ubar/index.htm

    3) Describe problem:

    I have been trying to replace my current menu (menubarAPI4.js) because of numerous script errors it causes. I chose jsDOMenubar because it seemed the best suited for my immediate needs as well as long range plans to generate custom menus based on user security. I spent 3 days writing and debugging the functions that build all the menus and submenus until I thought they worked. When I started doing more rigorous testing, I found that my browser was leaking memory at the rate of about 8MB per navigation. It only took a few clicks before the menu became so slow as to be unusable.

    I'm really stuck. I can't spend huge amounts of time to modify the old menubar code to get rid of all the errors and I can't use the new one as-is because of the massive leak. I've done some research on memory leaks and tried some of the simpler onunload functions to cleanup potential sources of leaks with no luck. Schemes like event-cache look promising but it looks like I'd have to make a lot of mods to the menu script.

    I know John Scheuer was working on something having to do with memory leaks... John, if you see this... PLEASE!!! Help.

    Thanks in Advance,
    Gandalf

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hi Gandalf:
    What version of IE are you seeing the leak? I did a quick test in IE7, and didn't discern any memory leaks. This is a rather complex script, so I don't think it's realistic for anyone other than the author to be able to address subtle issues like this. I've sent an email to the author alerting him of this thread, in case he has a quick fix at hand.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Eight megs per load? Ouch! It would help if you were to link to your page.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ddadadmin,

    I think that the e-mail to the author will be a big help. I am using IE6 by the way and IE7 is waaaaaaayy down the road. My client is a big company and they move very slowly on stuff like version upgrades.

    Twey,
    Yes 8MB really kills me. Unfortunately, the site I am working on is an intranet site and is behind a firewall and I can't get access for anyone outside the company. In addition, any code I do post has to be heavily sanitized. Because of the amount of code involved, it really isn't feasible for me to post much code. This means that though I appreciate the offer to look at the page, I am limited to asking questions and posting small snippets.

    Why I think it is something about the menubar...
    When I implemented the new one, I kept the old one around and I coded it such that all I have to change are a few lines in an include file to switch back and forth. Sure enough, switching back to the old menubar gave a ver slight leak and then switching back to the new and I was leaking around 8MB/load again.

    Please let me know if the author answers. I'd be happy to work with him as much as I can to figure out what the problem is.

    Regards,
    Gandalf

  5. #5
    Join Date
    Apr 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    I am the author. I knew the memory leak issue long before. I have an unrelease beta version that may be useful. Please see the attachments.

    Specifically, please check out the function releaseMemory and menuBarReleaseMemory. It may be possible to copy these two functions to resolve the issue, but I never try it before.

    In case you miss out, the last line in jsdomenu.js calls releaseMemory onunload:

    Code:
    window.onunload = releaseMemory;
    Note: The beta version may not be compatible with previous version as I have changed some function names. Still, it should be useful.

    Quote Originally Posted by gandalf97 View Post
    ddadadmin,

    I think that the e-mail to the author will be a big help. I am using IE6 by the way and IE7 is waaaaaaayy down the road. My client is a big company and they move very slowly on stuff like version upgrades.

    Twey,
    Yes 8MB really kills me. Unfortunately, the site I am working on is an intranet site and is behind a firewall and I can't get access for anyone outside the company. In addition, any code I do post has to be heavily sanitized. Because of the amount of code involved, it really isn't feasible for me to post much code. This means that though I appreciate the offer to look at the page, I am limited to asking questions and posting small snippets.

    Why I think it is something about the menubar...
    When I implemented the new one, I kept the old one around and I coded it such that all I have to change are a few lines in an include file to switch back and forth. Sure enough, switching back to the old menubar gave a ver slight leak and then switching back to the new and I was leaking around 8MB/load again.

    Please let me know if the author answers. I'd be happy to work with him as much as I can to figure out what the problem is.

    Regards,
    Gandalf

  6. #6
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for posting this. I'm not sure I will have time to try it today, but I will definately look at it.

    Regards,
    Gandalf

Bookmarks

Posting Permissions

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