Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Program slows as time goes on

Posted on 2004-10-05
5
Medium Priority
?
181 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 750 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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 how to record live broadcast.

719 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