tconkling / flump

Exports Flash .FLAs to GPU-friendly formats
MIT License
381 stars 70 forks source link

Trouble with memory #77

Open vshafran opened 11 years ago

vshafran commented 11 years ago

Hi, guys I try to use flump to create animations of heroes. My animation contains over 500 frames. When I used SpriteSheets with Starling for creating 200 identical animations in a cycle, my application took 26 - 30 Mb of memory. And the amount of DrawCalls was 1. But when I used Starling+Flump with identical animation it took almost 200 mb.

My code:

    const loader :Future = LibraryLoader.loadBytes(new ClassName());
    loader.succeeded.add(onLibraryLoaded);
    loader.failed.add(function (e :Error) :void { throw e; });

protected function onLibraryLoaded (library :Library) :void {

    movieCreator = new MovieCreator(library, Starling.juggler);

    for (var i:int = 0; i < 200; i++) {
        var movie:Movie = movieCreator.createMovie("MovieClipName");
        //or  var movie:Movie = library.createMovie("MovieClipName")
        movie.x = x;
        movie.y = y;
        addChild(movie);
    }

Could you help me with this trouble?

tconkling commented 11 years ago

We'd need to see the actual flump data to make any sort of diagnosis. How many texture atlases are being generated? How big are they?

vshafran commented 11 years ago

I load ZIP. Zip-file have a texture(256x128), library.json an other files. I load or embed this zip in my application(LibraryLoader.loadUrl or LibraryLoader.loadBytes).

I get Library after complete loading. After this I create a movies from a library in cycle. Flump create only one MovieCreator. And in each iteration MoviCreator creates an animation. Animation consist with 20 SubTextures (20 Sprites, 10 Layers, 660 frames in my fla file ). I add all movies to Starling.juggler. Thats all.

Where I do mistake? When I created 200 identical movies, I had 12 fps, GPU Memory 2,4 Mb, CPU memory 187 Mb.

P.S. Sorry for my terrible English ))

tconkling commented 11 years ago

It doesn't sound like you've necessarily made a mistake in your Flump usage - but we simply aren't able to debug your program without having access to it.

Have you profiled your program with Scout to see how all that memory is being used?

vshafran commented 11 years ago

Yes I have. I'll show it on the Monday, because it on the office PC.

vshafran commented 11 years ago

Hi. My info from Scout

Current Total Memory - 164,600 KB ActionScriptObjects - 154,393 Bitmap - 2,200 ByteArrays - 0 SWF Files - 681 Other - 82,275

Stage3D Draw Calls per Present - 24 Current GPU Memory 2,2971 Programs < 1 Textures 1,536 Index Buffers 123 Vertex Buffers 1,312

This is a link at scout file: http://us.ua/1173839/

May I send a project to you?

tconkling commented 11 years ago

Yeah - do you have Dropbox? You could stick it there and send me a link to it.

vshafran commented 11 years ago

This is a project with different libraries(Starling,Flump,DragonBones). You may see parameters for all libraries if you change class name when create new Starling class. Class names for different libraries: Pure Starling - SpriteSheets.as Flump - Game.as DragonBones - DragonBones.as

P.S. I found mistake with fps. File with project's properties was "read only", and my IntelijiIdea could not change property key="compiler.debug.swf" to "false".

But, I dont know, what do with memory.