Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 644961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:27:00+00:00 2026-05-13T21:27:00+00:00

in an attempt to see and hopefully understand actionscript’s garbage collector, i’ve set up

  • 0

in an attempt to see and hopefully understand actionscript’s garbage collector, i’ve set up a sample project that loop-tweens the value of a pixel bender parameter on stage.

my first concern was the amount of memory that was being used at launch (~26 MB). while i like to believe i’m cautious about memory by removing event listeners and nulling useless objects for the garbage collection as much as possible, i also believe i don’t fully grasp where, why and when it works.

the trace of the total system memory displayed a steady rise starting from around 26 MB until around 28 MB after about a minute later (or so). suddenly it’s plummeted down to 25 MB only to continue rising once again. this seems to cycle over and over.

here are some questions that come to mind:
1. is there a general time delay for the garbage collector?
2. does it activate after a certain amount of memory has been allocated?
3. can objects be explicitly removed immediately without relying on the garbage collector?
4. what is an acceptable range for memory usage when running flash?

attached is my code.

import fl.transitions.*;
import fl.transitions.easing.*;

var shader:Shader;
var shaderFilter:ShaderFilter;
var motionTween:Tween;
var filterParameter:Number = 0.0;
var loader:URLLoader = new URLLoader();
var phase:Boolean = false;

loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE, dataLoaded);
loader.load(new URLRequest("myBoringFilter.pbj"));

function dataLoaded(e:Event):void
 {
 loader.removeEventListener(Event.COMPLETE, dataLoaded);
 shader = new Shader(e.target.data);
 shaderFilter = new ShaderFilter(shader);
 flower.filters = [shaderFilter];

 tweenLoop(null);
 }

function tweenLoop(e:TweenEvent):void
 {
 if (motionTween != null)
  {
  motionTween.removeEventListener(TweenEvent.MOTION_CHANGE, updateFilter);
  motionTween.removeEventListener(TweenEvent.MOTION_FINISH, tweenLoop);
  motionTween = null;
  }

 phase = !phase;

 if (phase == true)
  {motionTween = new Tween(this, "filterParameter", Regular.easeOut, filterParameter, 100.0, 2.0, true);}
  else
  {motionTween = new Tween(this, "filterParameter", Regular.easeOut, filterParameter, -100.0, 1.0, true);}

 motionTween.addEventListener(TweenEvent.MOTION_CHANGE, updateFilter);
 motionTween.addEventListener(TweenEvent.MOTION_FINISH, tweenLoop);
 }

function updateFilter(e:TweenEvent):void
 {
 shader.data.amount.value = [filterParameter];
 flower.filters = [shaderFilter];

 //Update Memory
 trace("System Total Memory: " + System.totalMemory);
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:27:01+00:00Added an answer on May 13, 2026 at 9:27 pm

    This is generally the most common resource for this question:

    http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you attempt to declare an unsigned variable in C#.NET with a value outside
If I attempt to connect to Mac OS X 10.5 Leopard's built in vnc
In an attempt to add some parameter validation and correct usage semantics to our
I've decided to attempt using the double submitted cookies technique to attempt to prevent
Has there been any attempt and creating a formalized method for organizing CSS code?
This is an attempt to rephrase a question I asked earlier. I'd like to
When I attempt to use the iterator form of parsing for a Spirit grammar
For some reason when I attempt to make a request to an Ajax.net web
This is a pretty straight forward attempt. I haven't been using python for too
I am using the following code to attempt to read a large file (280Mb)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.