We have a simple question, but the cause is complicated. We are experienced developers, and have done a lot of research into what may be causing it. We are hoping that MonoT
Thanks to your reproduction we have found and corrected a very obscure issue in the garbage collector. It will be included in MonoTouch 4.0.2.
You asked:
"Internal kernel structures could not be allocated. ... How could this be?
One reason could be the fragmentation of the memory, for more on this topic see for example How to solve Memory Fragmentation. This may belong to other internal resources like file pointers, too. Therefore the problem is only visible on the resource limited devices and not in the simulator.
To find non obvious resource leaks, too: Are you using the Static Code Analysis (FxCop) of Visual Studio? Some of the rules give hints to free resources explicitly, e.g. to call Dispose or suggests to implement the IDispose interface.