Ever increasing RAM usage of flashPlayer

Software: Away3D 4.x

dhann, Newbie
Posted: 19 December 2013 07:15 PM   Total Posts: 4

In my flex application with away3d 3D-objects are created and added to scene and they are also removed/disposed again, and then they are created/added again.

Performing these scene altering operations the RAM usage of the flashPlayer process (monitored in Windows7-Taskmanager) steadily increases by big amounts (lets say 20MB).

On the other hand the Memory-profiler from FlashBuilder does not show any such increases at all. Regarding to memory profiler the application still uses bascially the same amount of memory (the line stays flat).

There are some objects marked as loitering, but they dont seem to build-up. And their total amount is (if at all) 0,3MB.

After a while of 3d-scene altering operations (adding, removeing objects) the application/flash-player crashes, most possibly to not being able to allocate more RAM (Taskmanager shows RAM almost completely used up by flashPlayer-process). The application does not exit due to 3d-resource related limits like vertex-buffers, but here are now my questions:

Questions:

a) Are there areas of RAM-usages an away3d application uses up, which can not be profiled by FlashBuilder?

For exmaple: Is it possible that some objects (maybe stage-3d related) that hold onto some areas of memory/RAM which do not show up in memory profiler?

b) Do you have any other idea what might be the cause here for increased RAM-usage or why it does not show up in memory profiler? I mean at least i expected to see it in memory profiler.

c) Is it possible that away3d could in theory use stage3d-api inappropiately (i am using a somehwhat patched version of away3d4 alpha) that could cause such problems? Or would it be more likely that this is a problem in flash-player itself?

d) Generally i understand that the flashPlayer allocates RAM as it sees fit, and that its not the same amount of memory my application currently uses. But if my application seems not to use/demand any more memory (at least thats what the profiler tells me) i dont understand why flashPlayer allocates more and more memory - even to the point of crashing. Any ideas here?

   

dhann, Newbie
Posted: 07 January 2014 03:47 PM   Total Posts: 4   [ # 1 ]

Does anybody has any suggestions/ideas regarding this?

   

Avatar
theMightyAtom, Sr. Member
Posted: 08 January 2014 07:13 AM   Total Posts: 669   [ # 2 ]

The most common problem I experience is running out of VRAM. This can quickly happen if you have large textures. To see what’s happening in VRAM, download Scout. Remember to reuse texture and geometry objects to reduce memory usage. If you post an example, others can also identify problems in Scout.

If you are using an alpha version of Away3D it would seem a good idea to upgrade to the latest version. The fact that textures have been taken out of materials and placed in their own BitmapTexture object can help to reduce memory allocation if used correctly.

Good Luck!

   

dhann, Newbie
Posted: 08 January 2014 09:37 AM   Total Posts: 4   [ # 3 ]

First of all: Thank you very much for your information! Do you know if having many or large textures (consumes VRAM as you were talking about, if i understood you correctly) also could cause the increase the RAM usage i see in Task-Manager. Because there is a difference in consuming RAM and VRAM, correct?

   

Avatar
theMightyAtom, Sr. Member
Posted: 08 January 2014 10:09 AM   Total Posts: 669   [ # 4 ]

Yes there is a big difference. Your RAM is managed by your OS, so you should never run out of RAM, just make a larger and larger swap file. Running on the GPU as Away3D 4.x does, you are reliant on the VRAM of your videocard. That doesn’t have the option of making a swapfile on your harddisk, so when it runs out it crashes spectacularly. If you are lucky you will get an exclamation mark in your browser window, but it’s not certain.

Flash has always been known historically for hogging as many resources as it can, both CPU and RAM, though I believe this has been re-engineered so the garbage collection should work fine as long as you remember to delete resources you’re not using.

Check out this and other articles on the net, for strategies for cleaning up.
http://gingerbinger.com/2010/07/actionscript-3-0-events-the-myth-of-useweakreference/

Cheers!

   

Avatar
theMightyAtom, Sr. Member
Posted: 08 January 2014 10:11 AM   Total Posts: 669   [ # 5 ]

Oh, and do try Scout. I don’t know how I ever got by without it!

   

dhann, Newbie
Posted: 08 January 2014 10:37 AM   Total Posts: 4   [ # 6 ]

Yeah, thanks very much for your suggestions. I will defnitely also check VRAM, but i dont think its the problem i have at the moment, because its definitely the RAM thats increasing.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X