Urgent: Serious lag related to System.privateMemory and possibly garbage collection
Hello
I'm porting a Flashgame to iOS. I already cpu-, render- and memory-optimized it and it runs really smooth on the device, EXCEPT for some very serious lags that always happen at the same time in the first level.
Here is a video showing the lags (sorry for bad quality, but the lags are very apparent):
I keep track of memory consumption over the runtime of the game, here is a screenshot:

(click for higher resolution)
color coding:
the blue line shows System.totalMemory
the green line shows System.freeMemory
the yellow line shows System.privateMemory
all lines are scaled in respect to their Peak value
the red lines show lags (black meaning the frame runs at the desired framerate and the red is something like reddishness = (1.0-fps/Stage.frameRate)*red), but only two of those lags are really relevant (marked in the screenshot).
at one of the lags, there is a very large drop in System.totalMemory, but only for a very short time (this spike always occurs, but randomly either on the first or on the second lag. i never observed it to happen on both lags and i never observed it to happen on neither lag)
The firing of the garbage collector is also visible in the graphic, but it does not seem to cause any lag - however it affects only System.totalMemory as well as System.freeMemory. System.privateMemory seems to be unaffected.
Manually calling the garbagecollector also doesn't solve the problem. in the following screenshot i make manual calls to System.gc() (visible as cyan collored lines) - and again it affects only System.totalMemory and System.freeMemory, but not System.privateMemory:

(click for higher resolution)
I need help in tracking down the problem. Does anyone have a good understanding in what exactly System.privateMemory is and what could cause the significant drop on the lags? also It's weird that the drop of System.privateMemory is always apparent on only one of the two lags, but never on both.
Any help on that is highly apreciated!
//edit:
The lags appear to happen at regular time intervals. if i make my character run at half the speed, there will be twice as many lag during level 1 and the memory usage will look like this:

