How to profile Monotouch to see the number of trampolines (by type) created at runtime?

There are quite a few reports of a trampoline of type 0, type 1 and type 2 and a run-time error

"trampolines are over"

on iOS devices.

I have a good understanding of how to increase the number of different types of trampolines during cross-compilation of AOT, however I fear the arbitrary increase in distributions whenever we encounter a ceiling at runtime.

I recently added a component that receives several Func<> arguments, and most consumers of this component anonymously create Func<> delegates. My assumption was that, although I could expect that every anonymous delegate would lead to the creation of a trampoline, the behavior that I think is observed is that instead of reusing this trampoline, it continues to create type 0 (ntrampoline [ method trampolines?] Each runtime of an anonymous delegate.

Which would be extremely useful is an api tool or call that would allow me to track, register or profile the application at runtime to observe the creation of the trampoline.

Any guidance on the side effects of either exposing the common delegate or the anonymous use of delegates will also be appreciated.

Thanks for any advice in the right direction.

Regards, Kevin Ferron

+4
source share
1 answer

It is best to ask such (very specific) questions in the mono-devel mailing list, i.e. there are a few questions (and wrt profiling suggestions) that would make it difficult to answer here (even if it could be marked correctly).

I assume you already read the links below (but they can help people wonder about trampolines).

You can also get some statistics from Mono using the - stats option. For instance.

 mono --stats myapp.exe ... JIT statistics Unwind info size : 198 Calls to trampolines : 626 JIT trampolines : 416 Unbox trampolines : 1 Static rgctx trampolines : 1 ... 

However, this will not help you in the context of MonoTouch, where AOT (much more) is used and where you do not control the execution of the application.

+3
source

Source: https://habr.com/ru/post/1380732/


All Articles