question

Joe Hopkins avatar image
Joe Hopkins asked

Unity game crashing on iOS 14

About every 5 to 60 minutes of gameplay our app will suddenly start using more and more memory until the app crashes. The problem started happening in iOS 14.

Below is the debug info output in the console before it happens (We are not sure if it is related.)

2021-02-09 11:22:04.084674-0500 superstarsports[629:37123] [tcp] tcp_input [C16.1:3] flags=[R] seq=3679659303, ack=0, win=0 state=CLOSED rcv_nxt=3679659349, snd_una=2526283774
2021-02-09 11:22:04.084858-0500 superstarsports[629:37123] [tcp] tcp_input [C16.1:3] flags=[R] seq=3679659303, ack=0, win=0 state=CLOSED rcv_nxt=3679659349, snd_una=2526283774
2021-02-09 11:22:04.085181-0500 superstarsports[629:37123] [tcp] tcp_input [C16.1:3] flags=[R] seq=3679659303, ack=0, win=0 state=CLOSED rcv_nxt=3679659349, snd_una=2526283774
2021-02-09 11:22:04.085492-0500 superstarsports[629:37123] [tcp] tcp_input [C16.1:3] flags=[R] seq=3679659303, ack=0, win=0 state=CLOSED rcv_nxt=3679659349, snd_una=2526283774
2021-02-09 11:22:04.157706-0500 superstarsports[629:37123] [tcp] tcp_input [C16.1:3] flags=[R] seq=3679659349, ack=0, win=0 state=CLOSED rcv_nxt=3679659349, snd_una=2526283774
2021-02-09 11:22:04.158193-0500 superstarsports[629:37123] [tcp] tcp_input [C16.1:3] flags=[R] seq=3679659349, ack=0, win=0 state=CLOSED rcv_nxt=3679659349, snd_una=2526283774
2021-02-09 11:22:04.158286-0500 superstarsports[629:37123] [tcp] tcp_input [C16.1:3] flags=[R] seq=3679659349, ack=0, win=0 state=CLOSED rcv_nxt=3679659349, snd_una=2526283774
2021-02-09 11:22:04.158378-0500 superstarsports[629:37123] [tcp] tcp_input [C16.1:3] flags=[R] seq=3679659349, ack=0, win=0 state=CLOSED rcv_nxt=3679659349, snd_una=2526283774

We are not 100% sure if it is PlayFab related. But we suspect that it could be.

unity3d
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image
Sarah Zhang answered

To figure out whether this issue is caused by the tool or PlayFab related code, could you please check which content causes the abnormal memory usage? For example, you can use Unity performance analysis tool Unity Profiler to check the memory details. You can also try to remove the PlayFab SDK in your project, then use the fake data to test the project again. You can contact Unity support for more suggestions about how to do the Unity performance analysis.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thomas Bizal avatar image
Thomas Bizal answered

@joehopkins @Sarah Zhang

I have been having this same issue for several months. I'm pretty positive I narrowed this memory leak down to PlayFab's server calls, but like you, I am still not 100% sure. It is incredibly difficult and time consuming to recreate the memory leak (sometimes it will happen after 5 minutes, but sometimes it will run for several hours before occurring), and when the crash does finally occur while testing in XCode, there is no useful crash information to help me pinpoint the cause any further.

I can't test using the Unity Profiler tool because the error will only occur on an iOS build (so the best option is to run the game on my iPhone while hooked up to XCode to view crash details). Or is there some other way I can run the game on my iPhone straight from Unity?

One other important point - this memory leak only began occurring suddenly after updating my Unity version. This all started so long ago, so I can't remember exactly which version I was on originally and updated to. It was originally at least 2019.4.15f or older (when it ran without memory leak crashed on iOS) and then I updated to I believe 2019.4.17f.

Have you had any more success debugging this? Strange that it only happens on iOS and seems to be fairly random.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matthew Miskiewicz avatar image
Matthew Miskiewicz answered

A similar thing is happening here. I have isolated the problem to playfab calls. It impacts perhaps 1% of ios users. Reinstalling the game always fixes it.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.