Solved

Program slows as time goes on

Posted on 2004-10-05
5
171 Views
Last Modified: 2010-04-03
So I have a rather large, multi swf application. Allows for all sorts of functionality, creates a ton of xml objects and arrays to swap data back and forth between movies all while tracking the user and all this other fun stuff.

Well anyways in final stages of development and its been noted that as people use the program for longer and longer periods of time it begins to slow itself down. It will take longer to bring up certain movieclips or it plays a video and takes longer to load. This usually occurs when the program is restarted multiple times (can be "restarted" from within the program). No setIntervals or onEnterFrmes on any of he swfs or mc's so i know its nothing like that running at least.

So question is this: Is there any way to actionscript trace what variables are being used without being in the debugger? I've deleted all i can think of in my restart procedure trying to clear up memory but it doesn't seem to be affecting much. Can't use the debugger because there are just WAY too many objects, mc's, variables and levels to deal with that flash crashes if i load in debug mode :(
0
Comment
Question by:Drakkon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:muso120999
ID: 12230567
> Is there any way to actionscript trace what variables are being used without being in the debugger?

If your page is in html, I tend to use:

getURL("javascript:alert(value = '" + myVariable + "');");

Or have a textbox in your clip, and add lines to it to trace.


> I've deleted all i can think of in my restart procedure trying to clear up memory

I've had a similar problem myself in the past, and due to the complexity, and timescale of the project, I ended up
having to clear-down by re-loading the page, and have a graphic in the background to hide as much as possible
this re-load.  It does get things running again.

Memory leaks can be difficult to source
0
 
LVL 4

Author Comment

by:Drakkon
ID: 12241451
i can test the program from within flash i just cant go into debug mode. So i can see the output window and any trace commands but i can't see whats going on with all variables at any given time like you can in debug mode.

Sadly this is a CD based app and thus can't exactly reload, im unloading layers but thats not seeming to clear up memory leaks. I'm not sure if its the flash garbage collector not doing its work or if its myself not deleting all possible variables. If there was just some way to see what variables were loaded for each level in the output window that would give me some indication....
0
 
LVL 10

Accepted Solution

by:
muso120999 earned 250 total points
ID: 12243119
This could do with some refining (I created it for another question to list the structure of an XML object), but it recurses through an object listing everything it finds:

showContent(this);

function showContent(obj:Object, oldProp:String) {
     var prop;
     for (prop in obj) {
          if ((typeof (obj[prop]) == "object")||(typeof (obj[prop]) == "function")) {
               var newProp = (oldProp==undefined) ? "["+prop+"]" : oldProp+"["+prop+"]";
                     trace(">> TYPE >> "+typeof (obj[prop]))
               trace(obj+newProp);
               showContent(obj[prop],newProp);
          } else {
                     trace(" -- "+typeof (obj[prop])+": "+prop+" = "+obj[prop]);
          }
     }
}


Just use showContent(myObject);

I hope it can be of some use to you.
0
 
LVL 4

Author Comment

by:Drakkon
ID: 12324015
thanx for the code there...helped definately in finding what variables were on each level. silly thing though would get caught too many levels of recursion but thats more my fault then anything :D well thanx anyways!
0
 
LVL 10

Expert Comment

by:muso120999
ID: 12324125
Oh yeah, only 256 levels of recursion!

Glad it helped though :-)
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Action Script commands 5 253
Action Script commands 3 224
Online Course Not Responding 3 98
Play RTMP without Flash 3 893
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question