Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

ran out of trampolines type 2 ???

Discussion in 'iOS and tvOS' started by yellow15, Apr 7, 2011.

  1. yellow15

    yellow15

    Joined:
    Dec 15, 2010
    Posts:
    7
    [UPATE 11/4/2011]
    Looks like LINQ is what is using up all the trampolines.
    Replacing some of the LINQ query with the our own "for loops" appear to fix/improve the "ran out of trampoline" crash issue.
    But we still want to know if the "trampoline" size can be increased from the project settings/or anywhere at all?
    We notice Monotouch has the build settings for user to increase the trampoline size so we would like to do the same thing for our Unity project. Thanks!




    we're having problems when running our application on iPad.
    Our unity app works fine under PC (Editor/Player), but when we compile it and run it on iPad, it constantly crashes at a few different places complaining "ran out of trampolines type 2"

    We have been looking up and down and tried a million things but still can't seem to find out what's wrong and more importantly how to fix it.

    Is there a way to increase the number of trampolines?

    Or if any one can help or give us some suggestions on how to fix this problem it would be really great as we are really running out of things we can do/try now :(
    Thanks a lot
     
    Last edited: Apr 11, 2011
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Hi, welcome to the forum!

    Can you give any more detail about the situations where this error occurs (ie, what happens just before it crashes)?
     
  3. yellow15

    yellow15

    Joined:
    Dec 15, 2010
    Posts:
    7
    Thanks for the quick reply. Unfortunately the crash can happen at different part of the code and we can't pin point what is causing it. But near the "crash zone " there are some coroutine calls, soap calls, SQL query and it also used to be near where we are calling our dll file and back but then we have changed and the main app now absorbed the dll's source code so that doesn't apply any more
     
  4. yellow15

    yellow15

    Joined:
    Dec 15, 2010
    Posts:
    7
    Update:
    Looks like LINQ is what is using up all the trampolines.
    Replacing some of the LINQ query with the our own "for loops" appear to fix/improve the "ran out of trampoline" crash issue.
    But we still want to know if the "trampoline" size can be increased from the project settings/or anywhere at all?
    We notice Monotouch has the build settings for user to increase the trampoline size so we would like to do the same thing for our Unity project. Thanks!
     
  5. benhorgen

    benhorgen

    Joined:
    May 12, 2011
    Posts:
    1
    This may be off topic, but Google's search results landed me here. Instead of refactoring LINQ statements out... I've updated my project settings in MonoTouch and that cleaned up the issue.

    In the "Additional MonoTouch arguments" field under "iPhone Build" I added the following to rid my application of pesky type 2 trampoline crashes. Enter this entire line:

    -aot="ntrampolines=2048"


    Hope that helps!
    -Ben Horgen
     
  6. Doolwind

    Doolwind

    Joined:
    May 13, 2011
    Posts:
    7
    We've run into this same problem but I am unable to resolve it. We are not using any LINQ so I can't use the fix you suggested. I've contacted Unity Technologies but have not heard back yet.

    Yellow15 - Could you give any more details of exactly what solved the problem for you?

    benhorgen - Thanks for the suggestion. Unfortunately I don't think there is a way we can set this with Unity. I tried setting it in MonoDevelop however the project settings are all overridden whenever Unity builds the project.
     
  7. balafish

    balafish

    Joined:
    May 4, 2012
    Posts:
    1
    i have the same problem about it , i am not using the LINQ,too.
    is any way can solve it?
     
  8. ubik2

    ubik2

    Joined:
    Feb 29, 2012
    Posts:
    3
  9. Ghost3D

    Ghost3D

    Joined:
    Sep 19, 2012
    Posts:
    5
    hi, i have the same problem. App craches with same exception. Exactly i got next issue: Ran out of trampolines of type 2 in '/private/var/mobile/Applications//.app/Data/Managed/mscorlib.dll' (128). I don't use LINQ, dynamic code generation, reflections which aren't supported by AOT compiler. Can anybody explain me what may be reason of this problem? Maybe there is someone AOT limitation and i don't know about it. Please don't suggest add option like this -aot "nimt-trampolines=512" because it won't help me understand main reason. Thanks.
     
  10. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    157
    This page:
    http://docs.xamarin.com/guides/ios/troubleshooting
    Has more info on trampoline errors. Type 2 mentions "heavy use of interfaces". I guess this would include LINQ as that uses IEnumerable<> a lot. Foreach() or IList<> may also cause interface use. Type 1 is recursive generics, but I have no idea what that refers to. class FooList : List<FooList> {} ??