Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
carbon

SWFLoader gc problem?

Recommended Posts

Hi,

During creating of TimelineMax-based-swf-animation player, i run into gc problem with loaded swfs. I tried to isolate problem as much as possible.. If you run it, memory is not released. I am using LoaderMax 1.5 2010-09-22.. hope I am not doing something bad.. :)

 

just weight

package
{
   import flash.display.Sprite;
   [sWF(backgroundColor="0x000000",frameRate="50",width="512",height="512")]

   public class BigSWF extends Sprite
   {
       [Embed(source="BIG_IMAGE.jpg")] public var IMAGE:Class;
       public function BigSWF() {
           this.graphics.beginFill(0xFF7000,1);
           this.graphics.drawRect(0,0,512,512);
           this.graphics.endFill();
       }

   }
}

tester

package
{

   import flash.display.Sprite;
   import flash.text.TextField;
   import flash.events.TimerEvent;
   import flash.utils.Timer;
   import flash.system.System;
   import com.greensock.events.LoaderEvent;
   import com.greensock.loading.SWFLoader;

   [sWF(backgroundColor="0xFFFFFF",frameRate="50",width="880",height="500")]

   public class GCTest extends Sprite
   {

       private const URL:String = "BigSWF.swf";
       private var c:int = 0;
       private var loader:SWFLoader;
       private var t:Timer;
       private var out:TextField;

       public function GCTest() {
           out = new TextField();
           out.multiline = true;
           out.width = stage.stageWidth;
           out.height = stage.stageHeight;
           addChild(out);

           t = new Timer(3000);
           t.addEventListener(TimerEvent.TIMER,go);
           t.start();
       }

       private function complete(e:LoaderEvent):void {
           out.appendText(" - complete");
           //
           loader.dispose(true);
           loader = null;
           out.appendText(" - dispose");
           //
           System.gc();
           out.appendText(" - gc");
           out.appendText(" - mem: "+Number((System.totalMemory*0.000000954).toPrecision(4)));
           out.appendText("\n");
           //
           t.start();
       }
       private function go(e:TimerEvent):void {
           out.appendText("#"+c+"\t");
           //
           t.stop();
           loader = new SWFLoader(URL,{name:"l"+(c++),container:this,onComplete:complete,noCache:true});
           loader.load();
       }

   }
}

Link to comment
Share on other sites

Nope, I'm pretty sure there's no memory leak. I let your code run 340 times and here's what I got:

 

#0	 - complete - dispose - gc - mem: 34.88
#1	 - complete - dispose - gc - mem: 34.78
#2	 - complete - dispose - gc - mem: 34.78
#3	 - complete - dispose - gc - mem: 34.88
#4	 - complete - dispose - gc - mem: 34.99
#5	 - complete - dispose - gc - mem: 35.09
#6	 - complete - dispose - gc - mem: 35.2
#7	 - complete - dispose - gc - mem: 35.3
#8	 - complete - dispose - gc - mem: 35.41
#9	 - complete - dispose - gc - mem: 35.51
#10	 - complete - dispose - gc - mem: 35.62
#11	 - complete - dispose - gc - mem: 35.62
#12	 - complete - dispose - gc - mem: 35.73
#13	 - complete - dispose - gc - mem: 35.82
#14	 - complete - dispose - gc - mem: 35.73
#15	 - complete - dispose - gc - mem: 35.82
#16	 - complete - dispose - gc - mem: 35.72
#17	 - complete - dispose - gc - mem: 35.72
#18	 - complete - dispose - gc - mem: 35.83
#19	 - complete - dispose - gc - mem: 35.82
#20	 - complete - dispose - gc - mem: 35.93
#21	 - complete - dispose - gc - mem: 36.04
#22	 - complete - dispose - gc - mem: 36.04
#23	 - complete - dispose - gc - mem: 35.93
#24	 - complete - dispose - gc - mem: 35.94
#25	 - complete - dispose - gc - mem: 35.94
#26	 - complete - dispose - gc - mem: 36.04
#27	 - complete - dispose - gc - mem: 36.04
#28	 - complete - dispose - gc - mem: 36.04
#29	 - complete - dispose - gc - mem: 36.04
#30	 - complete - dispose - gc - mem: 36.04
#31	 - complete - dispose - gc - mem: 36.04
#32	 - complete - dispose - gc - mem: 35.94
#33	 - complete - dispose - gc - mem: 35.94
#34	 - complete - dispose - gc - mem: 35.94
#35	 - complete - dispose - gc - mem: 35.94
#36	 - complete - dispose - gc - mem: 36.04
#37	 - complete - dispose - gc - mem: 36.04
#38	 - complete - dispose - gc - mem: 35.84
#39	 - complete - dispose - gc - mem: 35.83
#40	 - complete - dispose - gc - mem: 35.84
#41	 - complete - dispose - gc - mem: 35.94
#42	 - complete - dispose - gc - mem: 35.94
#43	 - complete - dispose - gc - mem: 36.04
#44	 - complete - dispose - gc - mem: 36.04
#45	 - complete - dispose - gc - mem: 36.04
#46	 - complete - dispose - gc - mem: 35.94
#47	 - complete - dispose - gc - mem: 36.04
#48	 - complete - dispose - gc - mem: 36.04
#49	 - complete - dispose - gc - mem: 36.04
#50	 - complete - dispose - gc - mem: 36.04
#51	 - complete - dispose - gc - mem: 36.15
#52	 - complete - dispose - gc - mem: 36.26
#53	 - complete - dispose - gc - mem: 36.25
#54	 - complete - dispose - gc - mem: 35.95
#55	 - complete - dispose - gc - mem: 36.05
#56	 - complete - dispose - gc - mem: 36.16
#57	 - complete - dispose - gc - mem: 36.25
#58	 - complete - dispose - gc - mem: 36.26
#59	 - complete - dispose - gc - mem: 36.05
#60	 - complete - dispose - gc - mem: 36.05
#61	 - complete - dispose - gc - mem: 36.15
#62	 - complete - dispose - gc - mem: 36.16
#63	 - complete - dispose - gc - mem: 36.15
#64	 - complete - dispose - gc - mem: 36.26
#65	 - complete - dispose - gc - mem: 36.15
#66	 - complete - dispose - gc - mem: 36.26
#67	 - complete - dispose - gc - mem: 36.25
#68	 - complete - dispose - gc - mem: 36.16
#69	 - complete - dispose - gc - mem: 36.05
#70	 - complete - dispose - gc - mem: 36.05
#71	 - complete - dispose - gc - mem: 36.16
#72	 - complete - dispose - gc - mem: 36.26
#73	 - complete - dispose - gc - mem: 36.05
#74	 - complete - dispose - gc - mem: 36.06
#75	 - complete - dispose - gc - mem: 36.05
#76	 - complete - dispose - gc - mem: 36.06
#77	 - complete - dispose - gc - mem: 36.16
#78	 - complete - dispose - gc - mem: 36.26
#79	 - complete - dispose - gc - mem: 36.37
#80	 - complete - dispose - gc - mem: 36.38
#81	 - complete - dispose - gc - mem: 36.06
#82	 - complete - dispose - gc - mem: 36.06
#83	 - complete - dispose - gc - mem: 36.16
#84	 - complete - dispose - gc - mem: 36.27
#85	 - complete - dispose - gc - mem: 36.27
#86	 - complete - dispose - gc - mem: 36.17
#87	 - complete - dispose - gc - mem: 36.17
#88	 - complete - dispose - gc - mem: 36.07
#89	 - complete - dispose - gc - mem: 35.96
#90	 - complete - dispose - gc - mem: 36.07
#91	 - complete - dispose - gc - mem: 36.06
#92	 - complete - dispose - gc - mem: 36.17
#93	 - complete - dispose - gc - mem: 36.28
#94	 - complete - dispose - gc - mem: 36.28
#95	 - complete - dispose - gc - mem: 36.18
#96	 - complete - dispose - gc - mem: 35.97
#97	 - complete - dispose - gc - mem: 35.97
#98	 - complete - dispose - gc - mem: 35.87
#99	 - complete - dispose - gc - mem: 35.86
#100	 - complete - dispose - gc - mem: 35.97
#101	 - complete - dispose - gc - mem: 36.07
#102	 - complete - dispose - gc - mem: 36.07
#103	 - complete - dispose - gc - mem: 36.18
#104	 - complete - dispose - gc - mem: 36.08
#105	 - complete - dispose - gc - mem: 36.07
#106	 - complete - dispose - gc - mem: 36.07
#107	 - complete - dispose - gc - mem: 36.18
#108	 - complete - dispose - gc - mem: 36.18
#109	 - complete - dispose - gc - mem: 36.07
#110	 - complete - dispose - gc - mem: 36.08
#111	 - complete - dispose - gc - mem: 36.18
#112	 - complete - dispose - gc - mem: 36.28
#113	 - complete - dispose - gc - mem: 36.28
#114	 - complete - dispose - gc - mem: 35.97
#115	 - complete - dispose - gc - mem: 35.97
#116	 - complete - dispose - gc - mem: 35.97
#117	 - complete - dispose - gc - mem: 35.97
#118	 - complete - dispose - gc - mem: 36.07
#119	 - complete - dispose - gc - mem: 36.18
#120	 - complete - dispose - gc - mem: 35.87
#121	 - complete - dispose - gc - mem: 35.86
#122	 - complete - dispose - gc - mem: 35.98
#123	 - complete - dispose - gc - mem: 35.87
#124	 - complete - dispose - gc - mem: 35.87
#125	 - complete - dispose - gc - mem: 35.87
#126	 - complete - dispose - gc - mem: 35.87
#127	 - complete - dispose - gc - mem: 35.97
#128	 - complete - dispose - gc - mem: 35.87
#129	 - complete - dispose - gc - mem: 35.87
#130	 - complete - dispose - gc - mem: 35.98
#131	 - complete - dispose - gc - mem: 35.97
#132	 - complete - dispose - gc - mem: 35.98
#133	 - complete - dispose - gc - mem: 36.07
#134	 - complete - dispose - gc - mem: 36.18
#135	 - complete - dispose - gc - mem: 36.18
#136	 - complete - dispose - gc - mem: 36.18
#137	 - complete - dispose - gc - mem: 36.28
#138	 - complete - dispose - gc - mem: 36.18
#139	 - complete - dispose - gc - mem: 36.28
#140	 - complete - dispose - gc - mem: 36.18
#141	 - complete - dispose - gc - mem: 36.18
#142	 - complete - dispose - gc - mem: 36.29
#143	 - complete - dispose - gc - mem: 36.07
#144	 - complete - dispose - gc - mem: 36.18
#145	 - complete - dispose - gc - mem: 35.97
#146	 - complete - dispose - gc - mem: 35.98
#147	 - complete - dispose - gc - mem: 36.07
#148	 - complete - dispose - gc - mem: 36.08
#149	 - complete - dispose - gc - mem: 36.07
#150	 - complete - dispose - gc - mem: 36.08
#151	 - complete - dispose - gc - mem: 35.97
#152	 - complete - dispose - gc - mem: 35.98
#153	 - complete - dispose - gc - mem: 35.97
#154	 - complete - dispose - gc - mem: 35.98
#155	 - complete - dispose - gc - mem: 36.07
#156	 - complete - dispose - gc - mem: 35.87
#157	 - complete - dispose - gc - mem: 35.97
#158	 - complete - dispose - gc - mem: 35.98
#159	 - complete - dispose - gc - mem: 36.07
#160	 - complete - dispose - gc - mem: 35.97
#161	 - complete - dispose - gc - mem: 36.07
#162	 - complete - dispose - gc - mem: 35.97
#163	 - complete - dispose - gc - mem: 36.07
#164	 - complete - dispose - gc - mem: 36.08
#165	 - complete - dispose - gc - mem: 36.07
#166	 - complete - dispose - gc - mem: 36.08
#167	 - complete - dispose - gc - mem: 36.07
#168	 - complete - dispose - gc - mem: 36.18
#169	 - complete - dispose - gc - mem: 36.29
#170	 - complete - dispose - gc - mem: 36.19
#171	 - complete - dispose - gc - mem: 35.98
#172	 - complete - dispose - gc - mem: 35.88
#173	 - complete - dispose - gc - mem: 35.87
#174	 - complete - dispose - gc - mem: 35.88
#175	 - complete - dispose - gc - mem: 35.98
#176	 - complete - dispose - gc - mem: 36.08
#177	 - complete - dispose - gc - mem: 35.97
#178	 - complete - dispose - gc - mem: 36.08
#179	 - complete - dispose - gc - mem: 36.08
#180	 - complete - dispose - gc - mem: 36.08
#181	 - complete - dispose - gc - mem: 36.08
#182	 - complete - dispose - gc - mem: 36.08
#183	 - complete - dispose - gc - mem: 35.98
#184	 - complete - dispose - gc - mem: 36.09
#185	 - complete - dispose - gc - mem: 36.09
#186	 - complete - dispose - gc - mem: 36.2
#187	 - complete - dispose - gc - mem: 36.19
#188	 - complete - dispose - gc - mem: 36.09
#189	 - complete - dispose - gc - mem: 36.19
#190	 - complete - dispose - gc - mem: 36.2
#191	 - complete - dispose - gc - mem: 36.09
#192	 - complete - dispose - gc - mem: 36.09
#193	 - complete - dispose - gc - mem: 36.19
#194	 - complete - dispose - gc - mem: 36.09
#195	 - complete - dispose - gc - mem: 36.09
#196	 - complete - dispose - gc - mem: 36.09
#197	 - complete - dispose - gc - mem: 36.19
#198	 - complete - dispose - gc - mem: 36.2
#199	 - complete - dispose - gc - mem: 36.19
#200	 - complete - dispose - gc - mem: 36.2
#201	 - complete - dispose - gc - mem: 36.19
#202	 - complete - dispose - gc - mem: 36.3
#203	 - complete - dispose - gc - mem: 36.19
#204	 - complete - dispose - gc - mem: 36.3
#205	 - complete - dispose - gc - mem: 36.19
#206	 - complete - dispose - gc - mem: 36.09
#207	 - complete - dispose - gc - mem: 36.09
#208	 - complete - dispose - gc - mem: 35.88
#209	 - complete - dispose - gc - mem: 35.88
#210	 - complete - dispose - gc - mem: 35.88
#211	 - complete - dispose - gc - mem: 35.98
#212	 - complete - dispose - gc - mem: 35.99
#213	 - complete - dispose - gc - mem: 36.09
#214	 - complete - dispose - gc - mem: 36.09
#215	 - complete - dispose - gc - mem: 36.09
#216	 - complete - dispose - gc - mem: 35.99
#217	 - complete - dispose - gc - mem: 35.88
#218	 - complete - dispose - gc - mem: 35.99
#219	 - complete - dispose - gc - mem: 35.88
#220	 - complete - dispose - gc - mem: 35.99
#221	 - complete - dispose - gc - mem: 35.98
#222	 - complete - dispose - gc - mem: 36.1
#223	 - complete - dispose - gc - mem: 36.2
#224	 - complete - dispose - gc - mem: 36.1
#225	 - complete - dispose - gc - mem: 35.99
#226	 - complete - dispose - gc - mem: 35.89
#227	 - complete - dispose - gc - mem: 35.99
#228	 - complete - dispose - gc - mem: 36.1
#229	 - complete - dispose - gc - mem: 36.09
#230	 - complete - dispose - gc - mem: 36.1
#231	 - complete - dispose - gc - mem: 36.09
#232	 - complete - dispose - gc - mem: 36.2
#233	 - complete - dispose - gc - mem: 36.2
#234	 - complete - dispose - gc - mem: 36
#235	 - complete - dispose - gc - mem: 36.09
#236	 - complete - dispose - gc - mem: 36.1
#237	 - complete - dispose - gc - mem: 36.09
#238	 - complete - dispose - gc - mem: 36.2
#239	 - complete - dispose - gc - mem: 36.09
#240	 - complete - dispose - gc - mem: 36.1
#241	 - complete - dispose - gc - mem: 36.2
#242	 - complete - dispose - gc - mem: 36.2
#243	 - complete - dispose - gc - mem: 36.1
#244	 - complete - dispose - gc - mem: 36
#245	 - complete - dispose - gc - mem: 35.89
#246	 - complete - dispose - gc - mem: 36
#247	 - complete - dispose - gc - mem: 35.99
#248	 - complete - dispose - gc - mem: 36.1
#249	 - complete - dispose - gc - mem: 36.09
#250	 - complete - dispose - gc - mem: 36.2
#251	 - complete - dispose - gc - mem: 36.1
#252	 - complete - dispose - gc - mem: 36.1
#253	 - complete - dispose - gc - mem: 36.2
#254	 - complete - dispose - gc - mem: 36.1
#255	 - complete - dispose - gc - mem: 36.09
#256	 - complete - dispose - gc - mem: 36.2
#257	 - complete - dispose - gc - mem: 36.2
#258	 - complete - dispose - gc - mem: 36.1
#259	 - complete - dispose - gc - mem: 36.2
#260	 - complete - dispose - gc - mem: 36.31
#261	 - complete - dispose - gc - mem: 36.2
#262	 - complete - dispose - gc - mem: 36.31
#263	 - complete - dispose - gc - mem: 36.41
#264	 - complete - dispose - gc - mem: 36.31
#265	 - complete - dispose - gc - mem: 36.3
#266	 - complete - dispose - gc - mem: 36.2
#267	 - complete - dispose - gc - mem: 36.2
#268	 - complete - dispose - gc - mem: 36.2
#269	 - complete - dispose - gc - mem: 36.09
#270	 - complete - dispose - gc - mem: 36.1
#271	 - complete - dispose - gc - mem: 36.1
#272	 - complete - dispose - gc - mem: 36
#273	 - complete - dispose - gc - mem: 36.1
#274	 - complete - dispose - gc - mem: 36.21
#275	 - complete - dispose - gc - mem: 36.2
#276	 - complete - dispose - gc - mem: 36.11
#277	 - complete - dispose - gc - mem: 36.1
#278	 - complete - dispose - gc - mem: 36
#279	 - complete - dispose - gc - mem: 36.1
#280	 - complete - dispose - gc - mem: 36.1
#281	 - complete - dispose - gc - mem: 36.1
#282	 - complete - dispose - gc - mem: 36.1
#283	 - complete - dispose - gc - mem: 36.1
#284	 - complete - dispose - gc - mem: 36.1
#285	 - complete - dispose - gc - mem: 36.2
#286	 - complete - dispose - gc - mem: 36.21
#287	 - complete - dispose - gc - mem: 36.11
#288	 - complete - dispose - gc - mem: 36.21
#289	 - complete - dispose - gc - mem: 36.31
#290	 - complete - dispose - gc - mem: 36.21
#291	 - complete - dispose - gc - mem: 36.1
#292	 - complete - dispose - gc - mem: 36.21
#293	 - complete - dispose - gc - mem: 36.11
#294	 - complete - dispose - gc - mem: 36.21
#295	 - complete - dispose - gc - mem: 36.21
#296	 - complete - dispose - gc - mem: 36.21
#297	 - complete - dispose - gc - mem: 36.21
#298	 - complete - dispose - gc - mem: 36
#299	 - complete - dispose - gc - mem: 36.1
#300	 - complete - dispose - gc - mem: 36
#301	 - complete - dispose - gc - mem: 36.1
#302	 - complete - dispose - gc - mem: 36.21
#303	 - complete - dispose - gc - mem: 36.11
#304	 - complete - dispose - gc - mem: 36.11
#305	 - complete - dispose - gc - mem: 35.9
#306	 - complete - dispose - gc - mem: 36
#307	 - complete - dispose - gc - mem: 36
#308	 - complete - dispose - gc - mem: 36.11
#309	 - complete - dispose - gc - mem: 36.21
#310	 - complete - dispose - gc - mem: 36.21
#311	 - complete - dispose - gc - mem: 36.21
#312	 - complete - dispose - gc - mem: 36.11
#313	 - complete - dispose - gc - mem: 36.21
#314	 - complete - dispose - gc - mem: 36.11
#315	 - complete - dispose - gc - mem: 36.11
#316	 - complete - dispose - gc - mem: 36.21
#317	 - complete - dispose - gc - mem: 36.21
#318	 - complete - dispose - gc - mem: 36.21
#319	 - complete - dispose - gc - mem: 36.21
#320	 - complete - dispose - gc - mem: 36.22
#321	 - complete - dispose - gc - mem: 36.11
#322	 - complete - dispose - gc - mem: 36.11
#323	 - complete - dispose - gc - mem: 36.11
#324	 - complete - dispose - gc - mem: 36.01
#325	 - complete - dispose - gc - mem: 35.9
#326	 - complete - dispose - gc - mem: 36.01
#327	 - complete - dispose - gc - mem: 36.11
#328	 - complete - dispose - gc - mem: 36.11
#329	 - complete - dispose - gc - mem: 36.01
#330	 - complete - dispose - gc - mem: 36.11
#331	 - complete - dispose - gc - mem: 36.21
#332	 - complete - dispose - gc - mem: 36.11
#333	 - complete - dispose - gc - mem: 36.11
#334	 - complete - dispose - gc - mem: 36.01
#335	 - complete - dispose - gc - mem: 36.01
#336	 - complete - dispose - gc - mem: 36.01
#337	 - complete - dispose - gc - mem: 36.11
#338	 - complete - dispose - gc - mem: 36.12
#339	 - complete - dispose - gc - mem: 36.01
#340	 - complete - dispose - gc - mem: 36.12

 

Keep a few things in mind:

 

1) Garbage collection isn't predictable. Your System.gc call will only work in the debugger version of Flash.

 

2) Memory would be expected to increase because you keep adding text to your TextField. It gets longer and longer with the results output.

 

3) If you look at my 340 cycles, you'll see the memory going up slightly, then down, then up, then down, etc. That's completely normal. If the SWFLoader's content was never being garbage collected, we'd see memory escalating much faster and we wouldn't see it going down.

 

Am I missing something?

Link to comment
Share on other sites

hmm, that's interesting..

1) i run it in both latest debugger plugin / projector

2) the loaded swf was about 5MB because of embedded jpeg so memory jumps were much higher.. i also tested it first with just logging it to Arthropod. I added TextField after to example to make it standalone

3) in my case i've seen just each cycle memory being increased by ~5mb with each loaded swf..

 

I am pretty surprised with your result, yesterday i tried it again with 1.6 and it was the same as with 1.5

Have to investigate it more..

Link to comment
Share on other sites

I wonder if it's the way you're embedding the image - could you please send me ALL the files necessary to simply open, compile, and see the issue? I don't have your image and there may be some other variables in our setups, so it's always SUPER helpful if you could provide the most dummy-proof files to open, compile, and see precisely what's going on. I prefer FLA files if possible, but I've got Flash Builder 4 and FDT too. I'm not a FlashDevelop guy.

Link to comment
Share on other sites

Hi,

I am TextMate and Flex sdk guy and even i own Flash CS5 I don't like (to put it mildly) using it :)

 

I made a few more tests..

 

flash player:

File: Flash Player.plugin
Version: 10.1.53.64
Shockwave Flash 10.1 r53

 

flex sdk:

Flex 4.1.0 16076
no changes to flex config, just latest release as it is

 

config for both files:

10.0.45

true
true
true

false
true

 

both debug build results (scenario where i noticed it..)

#0	 - complete - dispose - gc - mem: 11.83
#1	 - complete - dispose - gc - mem: 15.69
#2	 - complete - dispose - gc - mem: 19.93
#3	 - complete - dispose - gc - mem: 24.17
...
#18	 - complete - dispose - gc - mem: 87.98
#19	 - complete - dispose - gc - mem: 92.23
#20	 - complete - dispose - gc - mem: 96.49

 

both release build results

#0	 - complete - dispose - gc - mem: 11.37
#1	 - complete - dispose - gc - mem: 15.2
#2	 - complete - dispose - gc - mem: 15.21
...
#18	 - complete - dispose - gc - mem: 15.22
#19	 - complete - dispose - gc - mem: 15.22
#20	 - complete - dispose - gc - mem: 15.21

 

GCTest debug, BigSWF release build

#0	 - complete - dispose - gc - mem: 11.83
#1	 - complete - dispose - gc - mem: 15.67
#2	 - complete - dispose - gc - mem: 15.65
...
#18	 - complete - dispose - gc - mem: 19.87
#19	 - complete - dispose - gc - mem: 15.68
#20	 - complete - dispose - gc - mem: 15.68

 

GCTest release, BigSWF debug build

#0	 - complete - dispose - gc - mem: 11.41
#1	 - complete - dispose - gc - mem: 15.25
#2	 - complete - dispose - gc - mem: 19.51
...
#18	 - complete - dispose - gc - mem: 87.56
#19	 - complete - dispose - gc - mem: 91.8
#20	 - complete - dispose - gc - mem: 96.06

 

Seems like loading debug swfs is bad idea and this might be a deeper problem of Flash player, everytime you load debug swf, it won't get collected for some reason.. What do you think?

 

and source here, just add LoaderMax classes inside:

 

compiles just with

$ mxmlc FILE_NAME.as

if you on osx, have extracted sdk somewhere and have added its path to PATH like

export PATH=$PATH:/Applications/flex_sdk_4/bin 

 

don't know how to setup it on windows, but FDT might do all of this for you

 

c.

Link to comment
Share on other sites

Thanks for testing the results. Yeah, sure seems like a problem with the debug stuff, not LoaderMax. Unfortunately I just don't have time to try to figure out how to reproduce your setup and compile the way you do (I'm a Flash CS5 and Flash Builder 4 guy). But like I said, I couldn't reproduce the problem at all. I wonder if it's limited to the Mac too.

Link to comment
Share on other sites

And if you run swfs included in zip? They're both debug builds.. If it is ok, then it must be issue of osx player..

Link to comment
Share on other sites

No, when I run the files that you compiled in my standalone player, it does escalate. Seems like a compiler problem on your end (best guess right now).

Link to comment
Share on other sites

now i tried to compile it with flash cs5 (using flex sdk, because of embed tag) and when i run it in ide and also in plugin, it is like it was.. release build is ok, debug has the same problems..

take two: i added image to library and compiled without embed tag only with flash cs5 compiler, it is still the same

 

now i don't understand anything.. source is here, if you are interested

Link to comment
Share on other sites

I compiled in CS5 and memory usage did go up but then back down and kinda hovered in the same general vicinity (started around 105, got up to a max of around 155, but then went down to 132.8, edged up, then down, etc. even after 100 loads).

 

I did notice that the memory didn't creep up so much when I used a new LoaderContext with its own separate ApplicationDomain, like:

loader = new SWFLoader(URL,{name:"l"+(c++), container:this, onComplete:complete, noCache:true, context:new LoaderContext(true, new ApplicationDomain())});

 

So I suspect the issue has to do with the Flash Player's handling of where it puts the classes that are loaded - when it's walled off in a separate ApplicationDomain, it's easier to gc. Like the debugger version is overly greedy with its hooks, not wanting to release things because it wants to report various info about the resources/classes. And from what I can tell, this is NOT an issue in standard versions of the Flash Player - just debug versions.

Link to comment
Share on other sites

yea, i guess you're right.. something like that i thought too. I'd be only interested what would the result be using the same mechanism but with just plain Loader..

c.

Link to comment
Share on other sites

I just tried that and it confirms that the problem is NOT with LoaderMax - the same issue occured when only using a regular Loader. In fact, the problem was a bit more pronounced in that case. The LoaderMax version did a slightly better job of forcing gc at times. Definitely looks like another Adobe bug.

Link to comment
Share on other sites

I agree with you.. solution is just don't compiles debug swfs, which one should do anyway. I haven't seen this before, because these swf i usually compile through Ant with different config...

 

Thanks for clearing it up.

 

c.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×