Game crashes after 5 mins on device on iOS 8 due to Exception Type: EXC_RESOURCE

When I run my game in the corona simulator all is well. However when I run the game on my iPad mini retina with iOS 8.1 it crashes at the same moment in time due to the following error:

Exception Type: EXC_RESOURCE

Exception Subtype: WAKEUPS
Exception Message: (Limit 150/sec) Observed 368/sec over 300 secs

I’ve created a rather big and complex railroad tycoon sort of game that’s using a gameLoop with an enterFrame listener to handle all screen updates, gameModel updates, etc.

when further in the game, a lot is going on and per second some 25-50 objects need to be updated.

I’m using Corona SDK 2393a on a Mac with Yosemite.

I’ve got a couple of questions:

I understood after reading through the forum that corona is single thread only?

What specifically triggers a sleep/wakeup cycle in corona?

Any idea how to get the amount of wakeups below the limit of 150/s?

Here’s some example code from my gameLoop class:

 function loop:enterFrame() self.frames = self.frames + 1 if self.minutes == 5 then self.minutes = 0 end if self.seconds == 60 then self.seconds = 0 self.minutes = self.minutes + 1 logger:debug("minutes: " .. self.minutes) end if self.frames == 60 then self.frames = 0 self.seconds = self.seconds + 1 end self:update() end function loop:update() --update every frame self:updateTrains() --update every second if self.frames == 0 and self.seconds % 1 == 0 then self:updateGameStatus("updateDate") end --update every 3 seconds if self.frames == 0 and self.seconds % 3 == 0 then self:updateGameStatus("updateLevelGoals") end --update every 5 seconds if self.frames == 0 and self.seconds % 5 == 0 then self:updateCities() self:updateResources() end --update every 5 minutes if self.minutes == 5 then self:updateEconomy() end end

Whoops. Turns out I run into the 2038 problem as I use the os.date and os.time to generate a game date, as my game is in the “future” when the date 18 jan 2038 turns up the game crashes…

for more info see: http://en.wikipedia.org/wiki/Year_2038_problem

So this results in the above mentioned error. I saw that no matter when I start my game every time this specific date comes up it crashes. 

At least this is a problem I can fix :smiley:

Whoops. Turns out I run into the 2038 problem as I use the os.date and os.time to generate a game date, as my game is in the “future” when the date 18 jan 2038 turns up the game crashes…

for more info see: http://en.wikipedia.org/wiki/Year_2038_problem

So this results in the above mentioned error. I saw that no matter when I start my game every time this specific date comes up it crashes. 

At least this is a problem I can fix :smiley: