ActionScript 3.0 :: Huge Memory Leak In Loader Class?

Sep 16, 2011

When properly loading and stopping .swfs imported via the loader class the .swf is loaded into the memory. When i have close to 25 vids beeing played and each of them is about 5mb, it goes without saying that it takes alot of memory. When playing a video, selecting a new video, then going back to the old one, it loads 3 videoes intoo the memory because i use 1 single loader variable.. how you can prevent the memory leak?

View 9 Replies


Similar Posts:


ActionScript 2.0 :: Memory Leak In The New Loader Class?

Aug 3, 2006

I am making an application where I load a picture from the web at a rate of once per second. When I load a new picture I unload the old one the problem is that the old pictures are never completely erased from memory and the application keeps on consuming more and more memory until I'm guessing it eats all the memory in the cache (I haven't run it for that long yet :))

here is the code: what this does is load a picture when you click the screen, then unloads it when you click the picture. do it a few times and notice that the numbers (which show System.totalMemory) only go up but never go down to their original amount...

Code:

var url:String = "http://www.memorycity.com/shop/MBB/images/GIGABYTE_memory.jpg";
stage.addEventListener(MouseEvent.CLICK,onclick)
var txt:TextField = new TextField()

[code]....

View 1 Replies

Flex - Can't Find Huge Memory Leak In A Flex 4.6 Web Application?

Mar 16, 2012

I have a Flex 4.6 web game which displays 2 Lists with virtual layouts with 2 custom item renderers. The renderers consist mainly of BitmapImages displaying user avatars + few Labels.

The Lists are being updated often over TCP socket with gzipped JSON data. I merge that data into 2 ArrayCollections serving as dataProviders for the Lists. This seems to work well, the Lists do not flicker and are updated correctly (I've monitored debug traces a lot to get it right).

[Code]...

View 1 Replies

ActionScript 3.0 :: Loader Memory Leak?

Nov 20, 2009

While tracking down the source of a memory leak, I stumbled upon a strange issue with AS 3.0 and loading external flash movies. From what I can tell this somehow related to the custom classes stored inside the loaded movie. I have two versions of a basic file that contains one image on the stage (I also tried this with vector graphics with the same effect). One version has a custom document class (just a simple extends MovieClip with no additional code) and the other has no document class.

The graph below depicts the memory usage from loading the file without a document class.It performs the garbage collection as you would expect after each unload operation.However when I try to load and unload the same file with a document class, I get the following memory usage graph. As you can see, memory usage is slowly creeping up with each load operation.It almost seems that Flash is caching the class files, so I tried changing the application domain for the loaded content without success. Even if Flash was caching the class files I would assume that it would be able to detect that it had already cached the document class and simply re-load the cached version

View 4 Replies

Flash :: Memory Leak With The SuperPanel Class?

Feb 10, 2010

I have got a memory leak problem in the example below(u can download the code from the link)
http:[url]......

Running in Profiler:- What I am trying to do is creating new panels by selecting the Add new panel button.I am selecting option allow Close (check box).(After creating few panels and closing these panels i could find there is memory leak with the SuperPanel class) how to resolve this memory leak.I tried by changing optional parameters in addEventListener, but that didn't work.

View 1 Replies

ActionScript 3.0 :: Memory Leak With Display Class?

May 16, 2010

I have a serious memory leak problem. I think it's because of the use of etDefinitionByName() although I use removeChild and I put the reference to null. I made a example that illustrates this.

View 0 Replies

ActionScript 3.0 :: Remove One Of Main Memory Image That Was Loaded Using Loader Class?

May 27, 2011

Using ActionScript can I do with my game, which is running in a browser, verify that the user already has the files needed to run the game installed on your computer? If he had these files do not need anything else that was born and can play the game immediately. If he did not have the files, they would be loaded so that the browser does not erase these files. So when he returned to play the same game day after,as the files already on your computer, nothing need be loaded.How do I remove one of the main memory image that was loaded using the Loader class? I tried using the unload () method but nothing happened.

View 2 Replies

Memory Leak In My Shooter Game?

Oct 20, 2011

I'm very new to flash,and have been digging through google and this site for information on how to piece together an AS2 shooter game.Its going well enough, but I'm having slowdown issues the longer the games runs, and I was hoping someone here could point me in the right direction.To paste an enemy movie clip on the screen, i'm using this:

Code:
var spawn =_root.attachMovie("monster1","monster1"+_root.getNextHighestDepth(),_root.getNextHighestDepth())[code]........

I need them stored in an array so that the player's shots can test weather or not they've hit any monster on the bullet's enter frame function, then call that monster's movie clip's take damage function. I'm using a for loop to do this:

Code:
for(var i in _root.player.foes){
if (this.hitTest(_root.player.foes[i])){
_root.player.foes[i].takedamage();}
}

I think the problem with the slowdown is that each time I place an enemy on the screen the array gets bigger and bigger. The slowdown only happens while the player is shooting, and I suspect the ever longer for loop with the hit testing is causing it.

I'm already removing the monster's movie clips as they get killed or exit the screen, I guess what I need is a way to reduce the size of the array at the same time, or at least tell the for loop not to do a hit test unless the monster is still alive.

View 3 Replies

ActionScript 3.0 :: Memory Leak During CopyPixels?

Mar 1, 2012

I am making a custom renderer using the copyPixels function for my Haxe/Flash game. So I have this kind of code :

buffer.bitmapData.copyPixels(m_CurrentSkin, RECT3, POINT, null, null,true);

where :

-buffer is the bitmap where all my scene's objects are drawn

-m_CurrentSkinis the BitmapData that contains the current frame of the object to be drawn

Every time m_CurrentSkin contains a BitmapData that have never been drawn (the first time that an animation frame is drawn for example),I have a memory leak that is not garbage. However if m_CurrentSkin contains a BitmapData that have already been drawn (when the animation is played a second time for example), there isn't any memory leak.If I comment this line there is no leak so the problem comes from there.It seems that a copy of the BitmapData is cached in memory but I have checked in my code and there is no cacheAsBitmap explicitely set to true.

View 3 Replies

Flash :: Memory Leak Of Image?

Dec 9, 2010

I'm making a photo browser. I load 15 photos as Images and add these Images to HGroup every time. When user presses 'next page', I first unload the existing Images by 'Image.unloadAndStop()' and 'Image.source=null', and then load new photos. However, it seems that the GC never works. The task monitor shows that the memory use of my AIR reaches as much as 1.2G! Some people said it's a bug of Image when you load a picture larger than 1.5M. Is it true?

View 1 Replies

Flash - Memory Leak When Loading SWF?

Jun 13, 2011

I have a loader SWF that runs some code in the background and loads other SWFs. Using this code:

private function loadScreensaver():void {
screensaverSWF = new Loader();
var req:URLRequest;
switch(areaNumber){

[code]....

I load the screensaver and add it to the stage. Using MonsterDebugger I can see that memory steadily rises from around 80mb upwards until the application exits (Im using windows projector). What I can't work out is why, there is no code attached to the screensaver SWF, just some timeline animations of things fading in and out.

EDIT:I've kept testing and found where I have an image that starts of stage then tweens on and off and is removed. When it loops it adds to memory again, as if the first image is still kept. This is all done on the timeline.

View 5 Replies

ActionScript 3.0 :: Stopping The Memory Leak?

Apr 28, 2010

I am trying to find out how to stop the memory leaks that I seem to get when making up dynamically loading picture slideshows. It is difficult to try and give a perfect example of this so I would rater try and show it in action. Here are 2 separate tutorials on how to build a slideshow, though they are slightly different I think this will illustrate my point, there is one problem and that is that the only browser I know of that will show this correctly is Safari,[code]....

Ok now in safari open up your Activity window and take a look at how these 2 different slideshows seem to operate, Link 1 seems to have a memory leak,because each time the picture loads a new instance of it, if this were automated it would be a far bigger issue, like the second url of Link 1.Now when I make my own slideshows I find that mine are also like the first and second links and not like the third.

View 3 Replies

ActionScript 3.0 :: Memory Leak In Project?

Mar 31, 2011

i am working on this project wherein i instantiate an flvplayback at stage and let it play ,, after playing i instantiate 1-4 flvplaybacks on stage and the user kan nove choose a new film to watch .. but each time i instantiate the flvplayback(s) the project gets slower and slower .. the video gets bugggy and the sound is out of sync ..if anyone can see something wrong with the way i do it i would be ever so happy

[Code]...

View 1 Replies

ActionScript 2.0 :: Identify Memory Leak On Swf?

Feb 9, 2011

i saw that my app after some time, it becomes slow.. so i guess i have a memory leak? How could i be sure about that and track it down?

View 2 Replies

ActionScript 3.0 :: Memory Leak - Each Time My Swf Gets Reloaded?

Mar 24, 2009

I'm experiencing a few memory leaks each time my swf gets reloaded. I have closed the netstream, removed the listeners and the container, tried UnloadAndStop(); but in the end I'm still missing someting as some Mb leak anyways...Here goes my child swf source code:

Code:
////////// UrbanRevolution :MoD
////////// Built on "Video player a la Hulu" by Chris Brimelow http://chrisbrimelow.com
////////// FS function by noponies http://www.noponies.com/dev/as3_fsresize/[code]......

View 2 Replies

ActionScript 1/2 :: FLVPlayback Memory Leak In Flash CS3

Mar 31, 2010

I' making a flash file with AS2 in Flash CS3. I put a FlVPlayback in stage and let it load a couple of FLV files from my local HDD and playing continuously. I use "addEventListener" to check the current running flash movie is completed. After complete event occur, I load another flv movie to paly again.Here, I noticed that memory usage is increasing every time a new flv file is loaded and played. I heard "addEventListener" in CS3 is causing the memory leak and not being detected by GC. [code]

View 2 Replies

ActionScript 3.0 :: Memory Leak With Large Movieclip?

May 26, 2011

I'm having what strikes me as a stupid problem, but I can't figure it out myself... it could be a subtle nuance of Flash or just some knowledge I don't have, anyway... I'm making a Flash game with a main menu and multiple levels. We didn't organize our project right (just self-taught college students doing it in our free time) so we made a level before the main menu. I ended up putting the entire level, code and all, into a MovieClip. It creates an instance of that MC when you start a level (I'm sure this was a terrible idea).
 
But it leaks when I delete the MovieClip and create a new one (i.e. quit the level to the main menu and then start it again). It originally leaked ~6MB each time you quit and started it again, but I've tightened it up to ~1MB, but I'd still like to fix that.
 
I know to Garbage Collect something you have to remove references, so I've
Blanked all arraysNulled all referencesRemove all MCs dynamically added to the stage and any associated eventsRemoved every single MovieClip from the entire stage, including ones that weren't added dynamicallyNulled practically every object and variable I've only used weak-referenced events, and I've removed all of them anyway, but it's still leaking. There's way too much code for me to post all of it, so I guess I'm just wondering if anyone has any general ideas I haven't thought of.

View 2 Replies

ActionScript 3.0 :: Memory Leak On Timer Event?

Aug 16, 2011

I have create a simple timer with repeat count of 0, so it loops unlimited times.The timer repeats a function which calls for a PHP and displays data on the screen, so the data can be refreshed automatically.What I noticed though, is that the whenever the timer starts, it creats a memory leak on the system which makes the application memory usage to always go up.Is there any way to fix this?

View 11 Replies

Flex :: Find Where Is Memory Leak In Application?

Sep 7, 2010

How to find where is memory leak in a flex application?

Are there some tools to catch and analyze this problem?

View 2 Replies

Flex :: Spark Combox Memory Leak?

Feb 12, 2011

I have a simple, reproducable memory leak associated with the Spark Combo box, however I'm convinced it must be something I'm doing wrong, rather than an SDK bug.

// Application.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[code]....

Note - this doesn't occur when the application is compiled against Flex Hero.It appears as though this is a bug, but I cannot believe that the ComboBox has a memory leak -- surely this would've been fixed before 4.1 was shipped? Update I've done further investigation into this, and believe the issue lies in a problem with the RichEditableText component that the ComboBoxSkin uses.

View 2 Replies

Flex :: Memory Leak When Using SWFLoader In Adobe AIR

Aug 11, 2011

I'm trying to load windowed sub-application in another windowed application, The requirement is to replace one loaded application with another on user action.

I tried the documented method of unloadAndStop() on the swfLoader in the main windowed application, but somehow during memory profiling I could see the instances of those applications were maintained in the memory even after explicitly running garbage collection.

Where as If I make those windowed application as modules, and then try to load them using the Moduleloader things work smoothly and unloaded modules are removed from memory.

View 2 Replies

ActionScript 3.0 :: Application That Is Showing A Memory Leak

Jul 10, 2009

Iam trying to debug someone elses AS3 application that is showing a memory leak. The application is built with PureMVC.I have managed to locate the place where the memory leak seems to start. There is a button that causes the application to launch a slideshow. This draws a new graph every 8 seconds or so by creating a Timer. In the Timer handle function the code uses sendNotifaction() to set off series of events which basically boil down to getting information from a server and drawing a new graph.Now if I comment out the sendNotification() the memory leak stops, but if I leave the senNotification() in but comment out the code that subsribes to it the memory usage starts to build up.So my question is can simply firing off a sendNotification() every 8 secs in PureMVC cause a memory leak, even if not other code runs from this?

View 1 Replies

ActionScript 2.0 :: Memory Leak With Video Player?

Sep 6, 2009

I have an old project in AS2 with a video player that plays mp4s. I've noticed that FF tends to continue to eat up memory even after the video has stopped or has finished loading. I also am noticing jerky playback which I think has something to do with the memory leak.

ActionScript Code:
var server_nc:NetConnection = new NetConnection();
server_nc.connect(null);

[code]......

View 0 Replies

ActionScript 3.0 :: Dynamic Mcs And Memory Leak And Tweenmax?

Dec 5, 2009

I am creating mcs in a Timer loop, and I am not keeping any references to them; I am using tweenmax ( but it has a great reputation for being clean, so I doubt that it is the culprit );


ActionScript Code:
//--------------------------------------------------
function om_routine ( argo_e : TimerEvent ) : void[code]..............

View 4 Replies

ActionScript 3.0 :: Looping Video/MP3 Memory Leak

Dec 7, 2010

I have designed a site with a looping MP3 and video.

Problem is that the memory consumption of the Flash plugin goes up about 40mb every minute, and the site 'crashes' after a while. I would have thought that a single entity, that loops, would not have to re-load into memory, but this is what seems to be happening.

The looping video is approximately 800kb, and the MP3 is approximately 400kb.

how to minimize memory loss/consumption?

View 5 Replies

ActionScript 3.0 :: Memory Leak In Simple Slideshow?

Apr 8, 2011

It's caused by memory leak. Every time a slide is shown, the memory usage increases a few hundred kB. I've tried everything I could come up with, but even if I kick a whole lot of movieclips out, disable basically all AS3 and let only one slide loop, the memory usage still increases everytime the slide is shown again.Of course it helped to make the movieclips simpler, but the main problem remains: if you keep running the slideshow, it will slow down.

edit 1: #&^%@! Even when i copy one of the slides to a completely new file, with no external classes whatsoever, the problem remains. I think I know now what goes wrong:I make the movieclip loop by saying this.gotoAndPlay(1);Frame 1 is empty, the slide placed on frame 2. If I'd put the slide on frame 1, the mc wouldn't begin at the start and there is no animation (and no memory increase) because the mc has ended.I already figured that maybe every time the mc is shown again, Flash casts a new instance. To prevent that, everytime a slide ends, I remove it with removeChild(clip). That has no effect however, so I think that's unnecessary.

edit 2: even when the MCs are constantly on the stage and are restarted with clip.gotoAndPlay(1), the memory usage keeps growing.

View 4 Replies

ActionScript 3.0 :: Allowing XML To Be Interpreted Causes A 30 MB Memory Leak?

Jul 24, 2011

I have a 420 KB XML. Fairly large, yes. Its structure is fairly simple:

Code:
<Nodes>
<Node ID="1">

[code].....

View 8 Replies

ActionScript 3.0 :: Youtube Player Memory Leak

Nov 17, 2011

check out the profiler in flash builder. I need to get rid of the as3 youtube swf.Only about 20% of the memory is being released.Just copy and paste the code below into the main mxml file in a new flex project.[code]

View 2 Replies

ActionScript 3.0 :: Memory Leak With Tree Fractals

Jun 6, 2010

I am playing with tree fractals and everything is going great except for the fact that after the tree have been drawn there is still about 160mb being taken up in memory.

Code:
Select allpackage {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.GraphicsPath;
import flash.display.GraphicsSolidFill;
import flash.display.GraphicsStroke;
import flash.display.IGraphicsData;
[Code] .....

View 3 Replies

ActionScript 2.0 :: FLASH BUG (memory Leak - LoadVariables)

Apr 19, 2004

We are working on a project where Flash application should read in a constant loop variables from php script and then properly react. Everything works fine execpt after a memory usage start to grow at 1Mb/min, more or less... it varies from time to time. Our browser works then very slow (Mozilla Firefox, Opera, Mozilla Firefox and Mozilla for Linux) Our code:

[Code]...

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved