8 Replies Latest reply on Feb 3, 2010 11:45 AM by Adam Cameron.

    cfajax memory leak

    nasirk
      Have been experiencing odd behaviours on IE browser when using cfajax on cf8
      Specifying a cfm page in the source property in the cflayoutarea tag seem to be the problem. The browser memory increases by almost a megabyte on page refresh to an extent that on continously refreshing the page the memory gets filled up and causes performance to downgrade.

      The below example would be able to demonstrate the behaviour by creating these two pages and refreshing the first page and viewing on IE7.


      --------a.cfm------
      <cfajaximport tags="cflayout-tab">
      <cflayout type="Tab" >
      <CFLAYOUTAREA TITLE="TEST" source="b.cfm">
      hello this a test
      </cflayoutarea>
      </cflayout>

      ----b.cfm----
      hello
      <cfoutput>
      #now()#
      </cfoutput>


      ----end---

      Any help or suggestions..

      -Nas
        • 1. Re: cfajax memory leak
          Dave Phipps Level 1
          I have also heard reports of this occurring in Firefox (Win XP) although I haven't been able to duplicate it on Firefox (OS X). I'm actually looking at changing to use jQuery code instead of the built in cfajax stuff. It may be powerful but it is so bulky. Loading times can be quite staggering - even when just using a cfselect bind or a cfwindow.

          Sorry I can't help solve the problem but thought I would add to the discussion.

          Perhaps Adobe will pick up on this and rethink the ajax side of cf for cf9.

          Cheers,

          Dave
          • 2. cfajax memory leak
            The_Newguy
            Have run into something similar with IE. Have a page that uses nested cflayout/cflayoutareas. In these areas are other ajax features such as cfgrid. I have a menu that swaps source pages for layoutareas. If I get click-happy, IE7 eventually just hangs and crashes.

            Was trying to figure out how to either make a new, or use a current, global returnHandler function to change link styles to disable clicks while an ajax call in running. Any thoughts?

            To further, after about a dozen clicks back and forth, I end up with JS error..."invalid procedure call or argument"
            • 3. Re: cfajax memory leak
              Can you try "sourceless" technique
              <cfinclude template="b.cfm">

              instead of

              <CFLAYOUTAREA TITLE="TEST" source="b.cfm">
              hello this a test
              </cflayoutarea>

              I don't seem to have such problem though my cfwindow/cflayout etc tags are quite complex...

              • 4. Re: cfajax memory leak
                The_Newguy Level 1
                actually, our testing today has linked it to the cfgrid. remove all cfgrids and no problem. add even a completely blank cfgrid with no bindings or data and its 100% reproducable
                • 5. Re: cfajax memory leak
                  emccormick
                  Confirm problem in IE7. I have an app with 4 cflayoutareas -- 3 of which get a new cfgrid on submit. So far, I can't get past 5 submits before IE7 hangs. The ColdFusion AJAX Logger shows a "window" level message as follows:

                  window:global: Invalid argument.
                  ( http://host/dir/index.cfm?cfdebug, line N)

                  In my case, line N is always 18. It can't be line 18 of index.cfm because no matter how I arrange the code/whitespace in that section, it doesn't change. I've pasted the view source into my editor and line 18 is typically the <html> tag. oooookely Dokely!

                  I pulled the cfgrid widgets (html) out and voila! Infinite and MUCH faster returns. What a shame! Cfgrid is much more coder and user friendly than straight html tables and iframes.

                  • 6. Re: cfajax memory leak
                    aggie00
                    So, has anyone found a solution to this, possibly a "flush" or "garbage collection" javascript function that will eliminate this issue? We've got an interface that uses cfpod and we load multiple cfgrids from different links into the pods, and sure enough, on the 12th load or so, it bombs out. Anyone find a way to clear what I assume is a memory leak with the cfgrid? ANY help is GREATLY appreciated!
                    • 7. Re: cfajax memory leak
                      emccormick Level 1
                      I don't even know if Adobe has identified this as a bug, as I have yet to find a reliable list of CF8 bugs. Seems the Adobe Bug Base does not include ColdFusion. If anyone can point me in the right direction, I'll be certain to make sure they know about this. It couldn't be simpler to reproduce -- I have a sample app already built.

                      Meantime I had to make the unfortunate compromise in my production app to replace the grids with iframes.
                      • 8. Re: cfajax memory leak
                        Adam Cameron. Level 5
                        actually, our testing today has linked it to the cfgrid. remove all cfgrids and no problem. add even a completely blank cfgrid with no bindings or data and its 100% reproducable

                         

                        I realise this is an old post, but this situation has (potentially) cropped up again for someone else.

                         

                        Can you post some simple code that demonstrates this?

                         

                        It'd be good to get the issue onto Adobe's radar (I'm in the position to make sure it gets appropriate attention, at present).

                         

                        Cheers.

                         

                        --

                        Adam