Lieven Cardoen
Lieven Cardoen

Reputation: 25969

Are there limitations on the amount of memory that Flash player can use?

Are there any limitations on the amount of memory that the Flash player can use? If you have a SWF that over time gets a lot of data from the server, then more and more data will be kept in memory. Is there a limitation on this?

Upvotes: 9

Views: 9541

Answers (3)

George Profenza
George Profenza

Reputation: 51867

Iain has the right answer about checking the totalMemory used.

You could probably use a paging system. Although more and more data is loaded from the server I don't think all the data is used at all times. You could get data from the server and gradually save on the client's computer in a SharedObject( watch out for silesize limitations though) and you would keep track of what data is available locally( say data from index 0 to 900). If the user wants to see data between 200 and 300 you get stored data( if it aleady stored of course) , if not request the data and inform the user that data is on it's way.

Here are a few handy link related totalMemory and the Garbage Collector:

But what I think is more suited since there a lot data from the server, might be this: "What is the safe limit of flash player’s memory on web scenario and how well is AS 3.0 bit manipulation?"

Upvotes: 2

fenomas
fenomas

Reputation: 11139

Not in any version of Flash that runs on desktop PCs. As long as your application keeps using more memory, desktop Flash will keep requesting it from the OS, until the OS runs out of memory or something crashes. Of course you the developer should limit your memory usage as appropriate, but Flash won't force you to do so.

In Flash Lite (the mobile version designed for cell phones), the host application imposes preconfigured limits on memory usage, but that's probably not what you care about. :)

Upvotes: 6

Iain
Iain

Reputation: 9452

Check how much you are using with:

trace("MEMORY USAGE: " + (System.totalMemory/1048576) + "MB");

and watch out for leaks!

Upvotes: 5

Related Questions