Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with memory #77

Open
vshafran opened this issue Jul 12, 2013 · 11 comments
Open

Trouble with memory #77

vshafran opened this issue Jul 12, 2013 · 11 comments

Comments

@vshafran
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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

@vshafran
Copy link
Author

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
Copy link
Owner

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

@vshafran
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@tconkling @vshafran and others