out of memory error - can't find what is the reason

i have this code that was made from tips here long time ago.

var tm var tn; var rot = true; var rot2 = true; var th = 482; var tmh = 0; var $paneTarget = $('#lyr1'); var slideshow = { delay: 5000, actions:[], run: function() { if (slideshow.actions.length) { var current = slideshow.actions.shift(); current(); slideshow.actions.push( current ); tm = setTimeout(slideshow.run, slideshow.delay); } }, play: function(n) { if (n!=true) $(document).clearQueue(); if (slideshow.actions.length) { tm = setTimeout(slideshow.run, slideshow.delay); } }, pause: function() { clearTimeout(tm); $(document).clearQueue(); } }; $(".sideimg").each(function(){ var that = this; slideshow.actions.push(function(){ if (tn != "") { out(tn); **}** over($(that).attr("id")); n = $(that).attr("id").substring($(that).attr("id").indexOf("img")+3,$(that).attr("id").length) info("image.asp?id="+n+"","info"); var $target = $paneTarget.find('#'+$(that).attr("id")); var timg = document.getElementById($(that).attr("id")); if (timg.offsetTop>th||timg.offsetTop+timg.height>th||timg.offsetTop<tmh) { $paneTarget.stop().scrollTo( $target , 800 ); tmh = timg.offsetTop; } $("#rimg").fadeOut("slow",function () { slideshow.pause; $("#rimg").attr("src",$(that).attr("bsrc")).load(function(){ $("#rimg").attr("alt",$(that).attr("alt")); $("#rimg").fadeIn("normal"); slideshow.play; }); }); tn = $(that).attr("id"); }); });

the error is: "out of memory at line: 37" that line is the bold } (bold is not working because it is inside a code line so look for **}**)

it is not coming up after first loop or even the second - it takes long time until it will show up... maybe 20 min?

i had it runing in IE got the message... had it in Chrome and seems to be ok... had it in FF with firebug to see the DOM but no error after an hour

i realy don't know what to do...

update - i'm using jquery 1.4.1 and the error is in the jquery library (after 22-23 minutes of loop trought the images) i still don't know what to do


Ideally, all the objects your code allocates should be properly deallocated by the JS garbage collector. However, there are differences between the garbage collection implementation on the different browsers, which would explain why you see this error in IE only.

In particular, I know of at least one bug in earlier versions of IE (6 and below, don't know if it's there in 7+) where objects with circular references are not properly collected, thus leaking memory. I suspect you are hitting either this particular bug, or something similar.

Unfortunately, I don't have an easy solution for you; you might have to look into restructuring your code a bit to avoid the memory leaks.

The problems I see:


Should be


n is not defined: whatever you want with it define it in the correct scope.

Finally I don't know what over() and out(); is

Category:jquery Time:2010-07-10 Views:1
Tags: loops jquery

Related post

  • Should I bother detecting OOM (out of memory) errors in my C code? 2009-04-18

    I've devoted a large number of lines of C code to cleanup-labels/conditionals for failed memory allocation (indicated by the alloc family returning NULL). I was taught that this was a good practice so that, on memory failure, an appropriate error sta

  • How to handle OUT OF MEMORY error for multiple threads in a Java Web Crawler 2009-07-18

    I'm fairly new to programming and am working for my dissertation on a web crawler. I've been provided by a web crawler but i found it to be too slow since it is single threaded. It took 30 mins to crawl 1000 webpages. I tried to create multiple threa

  • Matlab "out of memory" error 2009-08-14

    When I run a sample script in Matlab, it says: Out of memory. Type HELP MEMORY for your options. When I type "memory", it reports: Maximum possible array: 156 MB (1.638e+008 bytes) * Memory available for all arrays: 740 MB (7.756e+008 bytes) ** Memor

  • Out of Memory Error in Eclipse 2009-10-20

    I am trying to install Spring framework in my eclipse ganymede through an update site http://springide.org/updatesite. But when it updates an error will occur in my ide which says that an out of memory error occurred. --------------Solutions---------

  • "Out of Memory" error in nokia 5610 while loading MP3 file 2009-11-02

    i am developing one j2me application to play wav & mp3 file. problems are: while try to play mp3 file in my phone (nokia 5610d) it is making "Out of memory" error. while try to play Wav file it is giving "Sounds are not allowed" exception. few li

  • PHp - memory error when resizing a PNG image 2009-11-12

    I have a script that creates a thumbnail out of an uploaded image. it works fine with jpgs, but gives me an error Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 26250000 bytes) when I upload a png image. The script is

  • Django / Python / PIL / sorl-thumbnail generation in bulk - memory error 2009-11-26

    I'm trying to bulk generate 4 thumnails for each of around 40k images with sorl-thumbnail for my django app. I iterate through all django objects with an ImageWithThumbnailsFieldFile, and then call its generate_thumbnails() function. This works fine,

  • bzr-svn out of memory error 2010-01-15

    When I try to do a bzr branch from my svn repository I get an out of memory error. The svn repository is very large. Is there a way to give bzr more memory? --------------Solutions------------- Try to branch in small steps. I.e. if you have 1000 revi

  • Large VBScript array yields 'Out of Memory' error 2010-01-26

    In Classic ASP (VBScript), if I try to create a large 2-dimensinal array, I get an "Out of Memory" error. For example, this DIM xxx : xxx = 10000 DIM yyy : yyy = 10000 REDIM aaa(xxx, yyy) Response.End yeilds this Microsoft VBScript runtime error '800

  • Software to track several memory errors in old project? 2010-02-10

    I am programming a game since 2 years ago. sometimes some memory errors (ie: a function returning junk instead of what it was supposed to return, or a crash that only happen on Linux, and never happen with GDB or Windows) happen seemly at random. Tha

  • JBoss5.X out of memory error 2010-03-02

    JBoss crashed with out of memory error, how do I prevent this? I modified the values in run.bat but result is same. "- Xms1024 Xmx1024 PermGen512" --------------Solutions------------- You might have a resource leak, in which case anything but finding

  • Avoid an "out of memory error" in Java(eclipse), when using large data structure? 2010-03-17

    OK, so I am writing a program that unfortunately needs to use a huge data structure to complete its work, but it is failing with a "out of memory error" during its initialization. While I understand entirely what that means and why it is a problem, I

  • C# CreatePipe() -> Protected memory error 2010-03-29

    I trying to create a pipe using C#. The code is quite simple but I get a error saying "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Here the COMPLETE code of my form : public partial class Fo

  • PL/SQL function while executing throws Out Process Memory Error 2010-04-26

    I have PL/SQL function, which is programmed to sort a set of data. This function work fine without any error, when called directly as a PL/SQL Function. However, when I call this Function Via a Unix Shell Script, even though the script returns a succ

  • "Out of Memory" error in Lotus Notes automation from VBA 2010-04-27

    This VBA function sporadically fails with a Notes automation error "Run-Time Error '7' Out of Memory". Naturally, when I try to manually reproduce it, everything runs fine. Function ToGMT(ByVal X As Date) As Date Static NtSession As NotesSession If N

  • how to avoid 'out of memory' errors when programmatically generating a lot of nodes in drupal? 2010-04-27

    I'm creating about 150 nodes programmatically and running into 'out of memory' errors when doing it all in a single request. (I have a menu callback that generates the nodes and calls node_save() on them.) Example: for($i=0; $i<150; $i++) { $node

  • How to demonstrate memory error using arrays in C++ 2010-05-05

    I'm trying to think of a method demonstrating a kind of memory error using Arrays and C++, that is hard to detect. The purpose is to motivate the usage of STL vector<> in combination with iterators. Edit: The accepted answer is the answer i use

  • how to generate thread dump java on out of memory error 2010-05-07

    does java 6 generate thread dump in addition to heap dump (java_pid14941.hprof) this is what happened to one of my applications. java.lang.OutOfMemoryError: GC overhead limit exceeded Dumping heap to java_pid14941.hprof ... I did find ava_pid14941.hp

  • Handling out of memory errors in iPhone 2010-05-07

    I would like to handle out of memory errors in iPhone to execute logic with lesser memory requirements in case I run of of memory. In particular, I would like to do something very similar to the following pseudo-code: UIImage* image; try { image = [U

  • GridView out of memory error 2010-06-03

    I use GridView to display thumbnails from MediaStore. If I launch and close my application 2-3 times it crashes with out of memory error. System.gc() is called in onCreate of main activity. If comment call setImageURI then no errors. Maybe I need to

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.430 (s). 13 q(s)