Reputation: 9
So, I created a libGDX project in android studio and gave it one image to show on screen, but once it ran on the emulator its kept increasing RAM Uage by the emulator till the point it has used almost all avaiable RAM? How can a simple image rendering on Emulator use this much RAM Please Help me with this Here are some pictures that might assist you Here is an image of my code
Here is the image of Emulator and Task Mananger
Upvotes: 0
Views: 67
Reputation: 669
Move new Texture(...)
to the create()
function, it is called only once.
render() is called multiple times per second, calling new Texture(...)
in this method will constantly create new textures which are stored in RAM.
This is what causes your RAM usage to increase so fast.
Upvotes: 1