Serious game-breaking issues with Graphics 2.0 Migration

memory is fine … it does not grow.  Keep in mind that as i said all i did was do a minimal migration dealing with setReferencePoint issues and setTextColor -> setFillColor.

Prior to the migration the app could run for hours without any degradation.  Now after playing for 20-30 minutes it gets very sluggish.

My texture memory starts at 13083700 then goes to 15186036 after i start the game then never changes.

My memory utilization always comes back down to the same value.

So i am quite sure i do not have any memory leaks.  Things just start slowing down after 20-30 minutes of play.

This is NOT the case when using build 1260.

I noticed the slowdown was really bad for TextCandy so i commented that all out but same result … i can see a jerkey screen … like it runs fine for about 1 second then stops for about 100 ms and cycles like that continuously.

The longer i play the longer that lag becomes.

Any clues would be most welcome.

Are you checking your Lua memory (using collectgarbage(“count”))  This is expressed in KB of memory.  You could be leaking there that wouldn’t show up in texture memory.

Rob

@dionny. Please try the latest public release as we’ve made a few bug fixes and changes to image loading

@mslack. Which version of Corona are you using, and are you using a compatibility layer for text candy? Can you provide a sample project that demonstrates the issue?

Think it was a memory leak but here is the interesting part … this really bad chunk of code i wrote about 2 years ago when i was first getting into Corona was the culprit :

It was getting called lots … every time someone touched the screen.
Sometimes in this game you have to think for an extended period of time and people were unhappy with their screens timing out.

However, this code leaks. Don’t think it was leaning prior to my jump from 1030 build to 2153 builds.

Thanks for all the guidance … here is the leaking code … may be something corona wants to look into.
 

system.setIdleTimer(false) if (self.removeIdleTimerTimer ~= nil) then timer.cancel(self.removeIdleTimerTimer) end self.removeIdleTimerTimer = timer.performWithDelay(240000, function () system.setIdleTimer(true) self.removeIdleTimerTimer = nil end )

To follow up (this is Dionny),

With the latest public build, the performance problem took longer to manifest itself (could play for about 15 minutes before it got overwhelmingly bad). I decided to thoroughly test the game for any memory leaks and found a huge problem with the legacy sprite library (prior to Graphics 2.0).

Important: After public build 2076, the legacy sprite library does not free used memory even with proper disposal techniques. After replacing all uses with the new sprite library, the performance-over-time of my game improved five-fold.

Just a thought. You guys should consider fully deprecating the old library so that users are forced to move to the new sprite libraries in order to avoid this problem with other customers.

Regards.

Dionny,

I finally decided to take the plunge into Graphics 2.0 … conversion went smoothly … tedious but smooth.

Then i started testing … all was well till i had played for 40 minutes or so then things started slowing down more and more.

Same game no changes other than the 2.0 required conversions for position and fill color but the performance over time is a non-starter.

Did you ever figure out a solution Dionny?

Reading the threads on this it is not clear to me that adding display.setDefault( “preloadTextures”, true/false )  would have any effect as my issue is not the same as those reporting lags on starting up their game.

Really appreciate any insights.

Cheers,

m

@dionny
you said your checking memory. are you checking during games play or only during scene change?

@mslack can you check your memory usage as well?

memory is fine … it does not grow.  Keep in mind that as i said all i did was do a minimal migration dealing with setReferencePoint issues and setTextColor -> setFillColor.

Prior to the migration the app could run for hours without any degradation.  Now after playing for 20-30 minutes it gets very sluggish.

My texture memory starts at 13083700 then goes to 15186036 after i start the game then never changes.

My memory utilization always comes back down to the same value.

So i am quite sure i do not have any memory leaks.  Things just start slowing down after 20-30 minutes of play.

This is NOT the case when using build 1260.

I noticed the slowdown was really bad for TextCandy so i commented that all out but same result … i can see a jerkey screen … like it runs fine for about 1 second then stops for about 100 ms and cycles like that continuously.

The longer i play the longer that lag becomes.

Any clues would be most welcome.

Are you checking your Lua memory (using collectgarbage(“count”))  This is expressed in KB of memory.  You could be leaking there that wouldn’t show up in texture memory.

Rob

@dionny. Please try the latest public release as we’ve made a few bug fixes and changes to image loading

@mslack. Which version of Corona are you using, and are you using a compatibility layer for text candy? Can you provide a sample project that demonstrates the issue?

Think it was a memory leak but here is the interesting part … this really bad chunk of code i wrote about 2 years ago when i was first getting into Corona was the culprit :

It was getting called lots … every time someone touched the screen.
Sometimes in this game you have to think for an extended period of time and people were unhappy with their screens timing out.

However, this code leaks. Don’t think it was leaning prior to my jump from 1030 build to 2153 builds.

Thanks for all the guidance … here is the leaking code … may be something corona wants to look into.
 

system.setIdleTimer(false) if (self.removeIdleTimerTimer ~= nil) then timer.cancel(self.removeIdleTimerTimer) end self.removeIdleTimerTimer = timer.performWithDelay(240000, function () system.setIdleTimer(true) self.removeIdleTimerTimer = nil end )

To follow up (this is Dionny),

With the latest public build, the performance problem took longer to manifest itself (could play for about 15 minutes before it got overwhelmingly bad). I decided to thoroughly test the game for any memory leaks and found a huge problem with the legacy sprite library (prior to Graphics 2.0).

Important: After public build 2076, the legacy sprite library does not free used memory even with proper disposal techniques. After replacing all uses with the new sprite library, the performance-over-time of my game improved five-fold.

Just a thought. You guys should consider fully deprecating the old library so that users are forced to move to the new sprite libraries in order to avoid this problem with other customers.

Regards.