What is the maximum amount memory Adobe AIR can utilize?

前端 未结 4 1828
离开以前
离开以前 2021-02-19 22:08

I\'ve been doing some rapid prototyping for a game I\'m thinking of building. one of the main things i want to do is map generation for a tile type map. While generating the map

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 22:38

    Not sure if you're already on this but you can play around with the property System.totalMemory to get a live readout of the amount of memory that flash is using at that moment (all instances of Flash Player/adl, so watch out if you have a browser open with flash content playing)

    Link: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/system/System.html#totalMemory

    It may help to display the memory used in a textfield on the screen or add it to a watch list as you debug to find out exactly what classes/methods are eating up all that ram! You could also take readings of the totalMemory and put in breakpoints to stop the program when it hits a certain threshold.

    It may also help to only generate a map large enough for what is on the screen, and generate further territory as the player moves in a certain direction and culling the territory that is out of bounds. This form of culling is popular in 3D games to eliminate unseen geometry but will also help for your problem of massive maps and limited memory.

提交回复
热议问题