Problem Description
it seems there is a memory leak or something like that I have no idea how you will call it.
The first time the App starts and Runs is all good and smooth Runs between 7 to 10% Cpu and as long as you keep Playing without closing the App or change the Layout the Cpu stays stable on those values.
Now the problem starts when the App closes for the first Time or at the change of the Layout the CPU jumps straight to 100 and stays there permanent the phone gets hot really hot, in one of the occasions it froze the IphoneX.
Here is the weird thing even when I change to (Layout 2) which has nothing just a Txt box and a Button the Cpu is still at 100 permanent I thought between layouts it shouldn't get affected by other Layouts
Closing the App and opening it again the same puts the Cpu to 100%
doesn't matter how many times you close it and open it the 100% Cpu doesn't calm down.
The only way to stop that and normalize the Cpu back to normal is by turning off completely the iPhone and restart again, but after restart the first time you open the App it will play normally at 7 to 10% Cpu and the sooner you close the App or change the Layout Cpu will be back to 100% permanent.
is quite serious as it nearly kills the phones
I tried to reproduce a Capx with the first thing that came to my mind so I didn't optimize anything and is nothing to do with my game I just put something quick roughly putting the number of objects
that I have on my real project and a loop to give c2 some work and it did the same so I manage to reproduce it Again
Attach a Capx
https://www.dropbox.com/s/c46xh0u38j8a8ep/3-Bug%20%28Cpu%20High%29%20When%20Reopen%20App.capx?dl=0
Description of Capx
The capx has just a basic controller so you can move around 300 Tiles and some enemies moving around,
and has some loop to change tiles frames just to keep C2 busy
Steps to Reproduce Bug
- Step 1 >> Export and Install the App on iPhone, I used Cocoon and Canvas+
- Step 2 >> The first Time you play as long you don't close the App or change the Layout keep watching the
Cpu to have an Idea how the App it should run normally I got around
Cpu = 7 to 10 on Iphone 8 and X
Cpu = 40 % on Iphone 7
- Step 3 >> once you have an idea about how the App it should perform close the App and
reopen it again you should see that the App jumps to CPU:100% and stays there permanent
you can change to (Layout 2) swell and the 100 Cpu will not calm down
- Step 4 >> After you opened and closed many times and changed layouts and you are sure that is
something wrong going on then you can turn off the iPhone and back on again and try the App
again
you will notice that the Cpu is back to normal, it will stay normal as longs as you don't close or
change the layout if you do then the 100cpu will be back again
- Step 5 >>I recorded some videos to help reproduce the Problem
I didnt want to make the videos long so this is what I did
1-I open the App for the first time and I move around for a few secs/min enough to show the
real Cpu usage wich the App it should run normaly
2-I close the App and open it again to show how the cpu Jumps to 100% and there is no way to
drop it down even I changed layout to layout 2 many times and is still showin 100%Cpu on a
layout that has nothing just a few objects with no events at all
Iphone 8:https://www.dropbox.com/s/4h0am6u4pvvjlxo/Iphone%208%20Plus.mp4?dl=0
Iphone X:https://www.dropbox.com/s/bn98tl1xelm2ife/Iphone%20X.mp4?dl=0
Observed Result
while you play if you close the App or change the Layout the Cpu jumps to 100% and stays there permanent,
even when you go to (layout 2) wich has 2 objects only no events the cpu is still 100%
Expected Result
I expect that the Cpu stays normal the same as the first time you play wich is when is totally normal doesn't matter how long you play the CPU stays cool, example on Iphone (8 and X ) Cpu is (7 to 10) %
I expect when I close the App and open it again if the App normally runs at Cpu: 7 to 10 % then it should be back to the same values not jump to 100%Cpu for no reason Trying to kill the Phones
I expect when I change Layout to (layout 2) which is empty and has no events to run I would expect if (Layout 1) Runs at Max Cpu: 10% with all those events and enemies and loops, then I would expect as an empty Layout Cpu should Run = 1% Maybe? 3%? Not Cpu:100%
Affected Browsers
- Chrome: (YES/NO) I don't know is an Exported App
- FireFox: (YES/NO) I don't know is an Exported App
- Internet Explorer: (YES/NO) I don't know is an Exported App
Affected Iphones
Iphone X
Iphone 8 Plus
Iphone 7 Plus
Operating System and Service Pack
Windows 10 version 1709
Construct 2 Version ID
Yesterday I installed the latest version R254
but previously I had R252 which is still affected