# iOS random hitches

**URL:** <https://forums.unrealengine.com/t/ios-random-hitches/295117>\
**Category:** Mobile\
**Tags:** unreal-engine, iOS, CPP, question\
**Created:** [October 2, 2014, 5:00pm UTC](https://forums.unrealengine.com/t/ios-random-hitches/295117 "2014-10-02T17:00:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_4dfa8a89](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4dfa8a89](https://forums.unrealengine.com/u/anonymous_user_4dfa8a89)\
**Post date:** [October 2, 2014, 5:00pm UTC](https://forums.unrealengine.com/t/ios-random-hitches/295117/1 "2014-10-02T17:00:57Z")

</div>

Hi,

I been working on an arcade iOS game for the past 3 months and at some point i started to notice some very noticiable hitches while running the game on any of my 3 testing devices (ipad 2, ipad 3 and iphone 5),

At first i thought that it was due to an unoptimized code so i started to strip down the level by removing elements one by one trying to find the source of the hitches

Now i reached the point where i have a totaly empty level with just my custom player controller and my custom default pawn and as my last resource i switched form the last stable version 4.4.3 to the git hub 4.5 preview to see if that fixed the hitches but they continue even if the game is left idle

Some details of my project settings

```
-Nither my default pawn or my player controller have the tick function enabled
-Mobile HDR On
-Target hardware is set Mobile/Tablet - Maximum Quality
-Platform optimized for mobile under iOS settings
-Support Metal Off
-Support OpenGL Es On
-AIModule, Slate, SlateCore and UMG Modules are loaded
-No extra plugins loaded

```

I ran this console commands on the devices to try to find the source of the hitches

```
stat unit
t.HitchThreshold 0.5    
stat hitches
stat dumphitches

```

this is an output from one of the hitches, they all look a like it seems **CPU Stall** is the one to blame but im not sure what it means i’m attaching a dumplog with several hitches while the game runing idle without interactions

```
[2014.10.02-15.46.54:995][957]LogStats: ------------------Thread Hitch, Frame 27952 276.3ms ---------------
[2014.10.02-15.46.54:997][957]LogStats: ------------------ Game Thread 276.27ms
[2014.10.02-15.46.54:998][957]LogStats: 276.13ms ( 3) - Thread_4a07_0 - GameThread - STATGROUP_Threads - STATCAT_Advanced
[2014.10.02-15.46.54:999][957]LogStats: 276.12ms ( 2) - FrameTime - STAT_FrameTime - STATGROUP_Engine - STATCAT_Advanced
[2014.10.02-15.46.55:000][957]LogStats: 271.28ms ( 1) - GameEngine Tick - STAT_GameEngineTick - STATGROUP_Engine - STATCAT_Advanced
[2014.10.02-15.46.55:001][957]LogStats: 264.81ms ( 1) - World Tick Time - STAT_WorldTickTime - STATGROUP_Game - STATCAT_Advanced
[2014.10.02-15.46.55:003][957]LogStats: 260.31ms ( 1) - GC Mark Time - STAT_GCMarkTime - STATGROUP_Game - STATCAT_Advanced
[2014.10.02-15.46.55:004][957]LogStats: 199.30ms ( 1) - Game TaskGraph Stalls - STAT_TaskGraph_GameStalls - STATGROUP_Threading - STATCAT_Advanced
[2014.10.02-15.46.55:005][957]LogStats: 199.29ms ( 1) - CPU Stall - Wait For Event - STAT_EventWait - STATGROUP_CPUStalls - STATCAT_Advanced
[2014.10.02-15.46.55:006][957]LogStats: 0.01ms ( 1) - OtherChildren
[2014.10.02-15.46.55:008][957]LogStats: 60.98ms ( 1) - Self
[2014.10.02-15.46.55:009][957]LogStats: 0.03ms ( 1) - OtherChildren
[2014.10.02-15.46.55:010][957]LogStats: 3.65ms ( 2) - Tick Time - STAT_TickTime - STATGROUP_Game - STATCAT_Advanced
[2014.10.02-15.46.55:011][957]LogStats: 3.10ms ( 7) - Game TaskGraph Tasks - STAT_TaskGraph_GameTasks - STATGROUP_Threading - STATCAT_Advanced
[2014.10.02-15.46.55:013][957]LogStats: 2.55ms ( 14) - FTickFunctionTask - STATGROUP_TaskGraphTasks - STATCAT_Advanced
[2014.10.02-15.46.55:015][957]LogStats: 1.36ms ( 26) - OtherChildren
[2014.10.02-15.46.55:018][957]LogStats: 1.19ms ( 1) - SoundscapePlayerController//Temp/Autosaves/Game/Maps/UEDPCGameBackup.UEDPCGameBackup.PersistentLevel.SoundscapePlayerController - STATGROUP_UObjects - STATCAT_Advanced
[2014.10.02-15.46.55:020][957]LogStats: 1.14ms ( 1) - Self
[2014.10.02-15.46.55:020][957]LogStats: 0.05ms ( 2) - OtherChildren
[2014.10.02-15.46.55:021][957]LogStats: 0.54ms ( 16) - OtherChildren
[2014.10.02-15.46.55:023][957]LogStats: 0.55ms ( 11) - OtherChildren
[2014.10.02-15.46.55:024][957]LogStats: 0.86ms ( 11) - OtherChildren
[2014.10.02-15.46.55:025][957]LogStats: 5.97ms ( 1) - RedrawViewports - STAT_RedrawViewports - STATGROUP_Engine - STATCAT_Advanced
[2014.10.02-15.46.55:027][957]LogStats: 3.57ms ( 1) - Self
[2014.10.02-15.46.55:028][957]LogStats: 1.72ms ( 9) - CanvasTextItem Time - STAT_Canvas_TextItemTime - STATGROUP_Canvas - STATCAT_Advanced
[2014.10.02-15.46.55:031][957]LogStats: 1.60ms ( 9) - Self
[2014.10.02-15.46.55:032][957]LogStats: 0.12ms ( 18) - OtherChildren
[2014.10.02-15.46.55:033][957]LogStats: 0.69ms ( 8) - OtherChildren
[2014.10.02-15.46.55:034][957]LogStats: 0.50ms ( 4) - OtherChildren
[2014.10.02-15.46.55:035][957]LogStats: 3.65ms ( 1) - Total Slate Tick Time - STAT_SlateTickTime - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:036][957]LogStats: 1.99ms ( 2) - DrawWindows - STAT_SlateDrawWindowTime - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:038][957]LogStats: 1.81ms ( 1) - OnPaint - STAT_SlateOnPaint - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:041][957]LogStats: 1.60ms ( 1) - OnPaint - STAT_SlateOnPaint - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:043][957]LogStats: 1.54ms ( 2) - OnPaint - STAT_SlateOnPaint - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:044][957]LogStats: 1.46ms ( 1) - OnPaint - STAT_SlateOnPaint - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:045][957]LogStats: 1.33ms ( 1) - OnPaint - STAT_SlateOnPaint - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:046][957]LogStats: 1.25ms ( 1) - OnPaint - STAT_SlateOnPaint - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:047][957]LogStats: 1.25ms ( 3) - OtherChildren
[2014.10.02-15.46.55:050][957]LogStats: 0.07ms ( 2) - OtherChildren
[2014.10.02-15.46.55:051][957]LogStats: 0.14ms ( 2) - OtherChildren
[2014.10.02-15.46.55:053][957]LogStats: 0.07ms ( 4) - OtherChildren
[2014.10.02-15.46.55:054][957]LogStats: 0.06ms ( 2) - OtherChildren
[2014.10.02-15.46.55:055][957]LogStats: 0.22ms ( 2) - OtherChildren
[2014.10.02-15.46.55:056][957]LogStats: 0.18ms ( 3) - OtherChildren
[2014.10.02-15.46.55:057][957]LogStats: 1.02ms ( 1) - Slate Rendering GT Time - STAT_SlateRenderingGTTime - STATGROUP_Slate - STATCAT_Advanced
[2014.10.02-15.46.55:058][957]LogStats: 1.02ms ( 3) - OtherChildren
[2014.10.02-15.46.55:060][957]LogStats: 0.63ms ( 10) - OtherChildren
[2014.10.02-15.46.55:062][957]LogStats: 1.19ms ( 11) - OtherChildren
[2014.10.02-15.46.55:062][957]LogStats: 0.01ms ( 1) - OtherChildren

```

I hope you can help me find a solution to this, the game core mechanic is based on music/timed events and i cant have this 1s-1/2s hitches happening randomly through the game

Let me know if you need more info about this, i’m not posting any code because the level is empty and the player controller and pawn code are striped to the very basics

Cheers!

---

<div class="post-metadata">

**Author:** ![gameDNA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gamedna/32/1209504_2.png) [@gameDNA](https://forums.unrealengine.com/u/gameDNA)\
**Post date:** [January 20, 2016, 4:13pm UTC](https://forums.unrealengine.com/t/ios-random-hitches/295117/2 "2016-01-20T16:13:56Z")

</div>

I have the same problem ☹

---

<div class="post-metadata">

**Author:** ![Spectral\_Ink](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spectral\_Ink](https://forums.unrealengine.com/u/Spectral_Ink)\
**Post date:** [March 19, 2016, 1:13pm UTC](https://forums.unrealengine.com/t/ios-random-hitches/295117/3 "2016-03-19T13:13:06Z")

</div>

I’m having the same problem. My game generates the level through blueprints, so one thought was that it was loading in assets and that was causing the hitch, but I tried loading everything into the level and burying it where it can’t be seen, but its still hitching. Seems to improve with multiple plays. when it’s not hitching it runs at 60 fps in most areas, then it will just hang, sometimes for a second or more.

---

<div class="post-metadata">

**Author:** ![Spectral\_Ink](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spectral\_Ink](https://forums.unrealengine.com/u/Spectral_Ink)\
**Post date:** [April 5, 2016, 7:05pm UTC](https://forums.unrealengine.com/t/ios-random-hitches/295117/4 "2016-04-05T19:05:36Z")

</div>

Just an update, I updated to 4.11. At first I thought I had gotten rid of them but in recent playthroughs the game still hitches.

I try to do the console command state hitchdump I think it is, but it would crash the game on ipad. Turned on the new merge clusters in garbage collection but many of the new options crash the game on ipad

---

<div class="post-metadata">

**Author:** ![tofusoup](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tofusoup](https://forums.unrealengine.com/u/tofusoup)\
**Post date:** [August 21, 2016, 7:39pm UTC](https://forums.unrealengine.com/t/ios-random-hitches/295117/5 "2016-08-21T19:39:58Z")

</div>

I got a response in another thread about similar issue… not sure if this will help.

If you want to disable GC in release builds to avoid hitches (if you are experiencing them); In the commandline when you run the game:  
-NoVerifyGC

I’ll be testing this

> **[Game Hitches (GC Mark Time?)](https://forums.unrealengine.com/questions/177892/game-hitches-gc-mark-time.html)**
>
> Hello guys, I have a somehwat important problem, as in my game, there are quite a lot of projectiles (for a mobile game at least) and after some time (like 30-40 seconds ca.) there is a huge lag. When tracking with the STAT XXXXX commands the GC...

> **[UE4 garbage collection fix?](https://forums.unrealengine.com/questions/292828/ue4-garbage-collection-fix.html)**
>
> I wanted to know if theres a work around to the automated garbage collection at 60 seconds and if not could that be requested? Like a means to specify when to call it? It seems big hitches called by the first gargbage collection of any gaming...

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

<div class="post-metadata">

**Author:** ![tofusoup](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tofusoup](https://forums.unrealengine.com/u/tofusoup)\
**Post date:** [August 21, 2016, 8:05pm UTC](https://forums.unrealengine.com/t/ios-random-hitches/295117/6 "2016-08-21T20:05:18Z")

</div>

I tried NoVerifyGC and still get a hitch. No clue 🙂
