I downloaded Corona a few months ago and have been making a game. I have had no issues whatsoever with the Corona simulator crashing until just recently. I started noticing that it would occasionally crash (maybe 1 or 2 times every couple of hours).
Today, it is now crashing consistently every time I get to my main gameplay screen.
I added memory monitoring code to my main like this:
local monitorMem = function() collectgarbage() print( "\nMemUsage: " .. collectgarbage("count") ) local textMem = system.getInfo( "textureMemoryUsed" )/1000000 print( "TexMem: " .. textMem) end Runtime:addEventListener("enterFrame", monitorMem)
When I am in the main game screen, the numbers are staying consistent and not rising at all.
14:06:26.063 MemUsage: 1391.57421875
14:06:26.063 TexMem: 14.198268
14:06:26.084
14:06:26.084 MemUsage: 1390.87890625
14:06:26.084 TexMem: 14.198268
14:06:26.101
14:06:26.101 MemUsage: 1391.59765625
14:06:26.101 TexMem: 14.198268
14:06:26.117
14:06:26.117 MemUsage: 1392.31640625
14:06:26.117 TexMem: 14.198268
14:06:26.135
14:06:26.135 MemUsage: 1392.31640625
14:06:26.135 TexMem: 14.198268
14:06:26.150
14:06:26.150 MemUsage: 1392.34375
14:06:26.150 TexMem: 14.198268
14:06:26.173
14:06:26.173 MemUsage: 1390.85546875
14:06:26.173 TexMem: 14.198268
It stays around 1390 and 14.1 the entire time it is in the game screen until it crashes without going up.
The crashes seem to happen anywhere from as fast as 5 seconds into my game play , to as long as 1 minute. Some take around 30 seconds.
Recently, I have been changing some of code relating to restarting my level. So I’ve been setting up key presses to remove all enemies and then another key press to restart the level by resetting everything and respawning the enemies.
It seems like the crashes started happening more and more while I was tweaking the code. However, I think I have the code fixed now (based off the MemUsage and TexMem) but now the crashes are happening every single time.
I tried restarting the laptop.
I also know that recently (a few days ago I think), Windows did an automatic update, so I’m not sure if something got screwed up because of that.
I would post code but I have lots of modules and hundreds of lines of code so I’m not sure what to even post.
It’s weird because of 90% of my code has been the same for the past several weeks and I was not getting any of these crashes until just recently.
Any tips on what I can try?