# CatNap Memory Leak?

**URL:** <https://forums.kodeco.com/t/catnap-memory-leak/12830>\
**Category:** 2D iOS & tvOS Games by Tutorials\
**Created:** [April 8, 2016, 2:15pm UTC](https://forums.kodeco.com/t/catnap-memory-leak/12830 "2016-04-08T14:15:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghostmoki](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ghostmoki/32/89849_2.png) [@ghostmoki](https://forums.kodeco.com/u/ghostmoki)\
**Post date:** [April 8, 2016, 2:15pm UTC](https://forums.kodeco.com/t/catnap-memory-leak/12830/1 "2016-04-08T14:15:43Z")

</div>

Hi,  
I’m currently working through the CatNap example game and have noticed the memory usage gradually increasing as the game runs with the cat sitting idle - eventually the game is being shutdown by iOS due to memory usage.

Is there a known memory leak with the game or is it possible I’ve done something to cause this?

Thanks!

---

<div class="post-metadata">

**Author:** ![ghostmoki](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ghostmoki/32/89849_2.png) [@ghostmoki](https://forums.kodeco.com/u/ghostmoki)\
**Post date:** [April 8, 2016, 2:46pm UTC](https://forums.kodeco.com/t/catnap-memory-leak/12830/2 "2016-04-08T14:46:14Z")

</div>

Answered my own question by digging a little more into this:

It seems that setting “showsPhysics” to true on the SKView in GameViewController.swift in order to see the PhysicsBody on each node is causing the memory leak.

Turned that setting off and the game is now stable.

---

<div class="post-metadata">

**Author:** ![keydogg](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/keydogg/32/102075_2.png) [@keydogg](https://forums.kodeco.com/u/keydogg)\
**Post date:** [April 15, 2016, 11:13pm UTC](https://forums.kodeco.com/t/catnap-memory-leak/12830/3 "2016-04-15T23:13:43Z")

</div>

Thanks for posting this. I ran into this making DropCharge as well. Set “showsPhysics” to false and fixes the memory leak.

As a related topic do you have to turn these settings to false before submitting to app store?  
skView.showsFPS = true  
skView.showsNodeCount = true  
skView.showsPhysics = true
