Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

Why do my images take 200 MB of RAM when they are ~20KB on disk?

$
0
0

I am creating an Android game using libGDX. When I load my nine images it takes 200 MB of RAM. But the images are 10 to 17 KB each. Why the discrepancy? Here is where I create textures from those images:

public static HashMap<String, Texture> ground = new HashMap<String, Texture>();
for (int i = 1; i < 10; i++) {
  ground.put(
  "ground" + i,
    new Texture(Gdx.files.internal("groundImages/ground" + i + ".png"))
  );
}

Viewing all articles
Browse latest Browse all 434

Trending Articles