Hi again, i have a memory problem and i can’t see where it’s coming from, i add entities to my world (like 550 entity), but that’s not the problem, once i add them all bu reading coordinates from a script the memory is almost 300M, when i play the game i notice that the memory is increasing bu 0.01M almost every 30s, i removed all entities and kept just the player, the memory was stable and not increasing, i added one simple type of entities then the memory got back to increase again :
public class Level extends Entity
{
[Embed(source = "../../assets/images/tile.png")]
protected static const TILE_ART:Class;
protected var _levelImage:Image;
public function Level(xPos:int)
{
this.x = xPos;
this.y = 0;
initLevelImage();
layer = 3;
type = "level";
}
override public function update():void
{
if (x < FP.camera.x - 1000) {
world.remove(this);
}
if (Globals.playerAlive == false) {
active = false;
}
}
private function initLevelImage():void {
_levelImage = new Image(TILE_ART);
mask = new Pixelmask(TILE_ART, 0, 0);
}
I even removed the update method and the mask but nothing changed !