The problem was not just that, it really was my mistake. I did not know how the images consumed memory and then was due to the excess of images that my game crashed.
Despite being a relatively small game, I put enormous backgrounds for the character around.
The problem I had with the previous Template, was a compilation error, but all the rest was due to an overload on the use of images.
For this, I created a calculator in Excel to help me in maintaining the memory game. It would be interesting to post it here on the forum?
I would like to thank all who were willing to help me, hope one day to return the favor.