Memleak Is Back, and Brought His Minion, Crafting Bug

Hey Folks! No fix for the iPad 3 crash bug yet, but the situation is developing.

It turns out this may be a memory leak after all. Tiago got his hands on an iPad 2 for testing, and while the timing is different, the outcome is similar. He was also able to spot some weird memory usage patterns. Up until now, I've erroneously thought my iPad 3's memory usage was stable, but could confirm in my latest tests that it was going nutso. Like MB/s increases and then garbage collection.

What's more, the increases start fast and small, and get slower and larger as time passes. This could just be a memory reporting idiosyncrasy, but I think Tiago is confirming it in memory profiling tools outside of the game, as well.

So what does this mean? Well, for one thing, maybe our memory leak has returned. Or else we have a new one that is quite aggressive and sudden. I guess the good news is that we have a better idea what we're looking for now, and maybe even some crash logging to help. But no fix just yet.

I also stumbled across a bug during some testing today. I decided to start an earnest playtest as a way to start collecting useful screenshots for the App Store. And while crafting boiled water in a whiskey bottle, I managed to crash the game.

This sounded familiar, and checking over my issue list, I found why: one of the beta testers noted a similar crafting issue a couple weeks ago. One which I was not able to reproduce.

The trick, it turns out, was that I had to craft boiled water with a whiskey bottle while the water was inside. Water outside the bottle won't do it. From the looks of it, the water in the bottle is getting destroyed/nullified before the recipe is done with it, possibly as a result of destroying the bottle before dealing with the water? I'll have to look into it more tomorrow.

But 100% repro steps are a great start! Now if we could just figure out the source of that leak...


Malacodor's picture

What you write about the leak sounds like automatic memory allocation of a container that increases its size by a percentage of its current size and gets fed with tons of data.

Ran around with a clown mask before it was cool

dcfedor's picture

I think we've actually solved that memory inflation issue, and it turned out to be unreleased listeners in the various platform extensions. I guess we were spawning listeners to see if various IAP/game center calls/etc. finished, but never cleaned them up when done.

Possibly on the order of many times per second.

It's weird, though. Even with that leak fixed, the game still crashes after a few minutes. Even weirder, memory now seems ultra stable up until the crash, with no signs of a sudden increase.

So...did we just stumble upon a memory leak while investigating, fix it, and are now still blind as to the true crash cause?

"Haunting" is back on the short list :)

Dan Fedor - Founder, Blue Bottle Games