The playstate loads my overworld tilemap so that is always in the background of the battle system but I disable the map stuff from updating when the battle system is open. The battle system used to be a substate of the playstate but that was not working properly with my complex menu system so I decided to use a FlxGroup for my battle system. For a few days I tried getting the revive system working properly but it had memory issues. Then I just decided to completely open a new playstate after each battle since I think most games switch states after each battle. I thought the memory would be released every time a state is changed but that did not help. I think maybe it made it worse but I am not sure..
The game starts at around 90 to 100 MB memory usage then climbs higher and higher. After one hour the memory usage was at 950 MB but I realized the battle system stopped since I ran out of units. I think it would have been closer to 1200 MB. The battle system is turn based rpg type so there are not 20 bullets being created every second or anything like that. I have 14 units (7 for player and 7 for enemy), 14 health bars, 14 FlxText to display the number of units, a spell bar at the bottom etc. If you have played heroes of might and magic III then it looks pretty much exactly like that except my units never move on a grid and battles last something like 5 seconds.
The first image is what the game looks like after starting it. The second image is after the game runs for around an hour. I am not really sure how to interpret this stuff but things are definitely getting higher. I tried everything I can think of already which is why I tried using this Flash Develop SWF Profiler thing. I do not have windows 7 so I can not use adobe scout.