TimSim
TimSim

Reputation: 4036

libgdx - measuring memory usage on Android

The only thing I could find to get memory usage was

Gdx.app.getJavaHeap();

Gdx.app.getNativeHeap();

And this is very steady (polled once per second) at 10M and 7M respectively. I have two questions:

  1. Does this mean my app uses only 17M of RAM? Because that seems kind of low.
  2. Does this mean I don't have any significant memory leaks?

Upvotes: 2

Views: 2480

Answers (1)

Alexandre Santos
Alexandre Santos

Reputation: 8338

  1. Being stable at 10M is a good indicator, but it doesn't mean that this is all your app requires, it might be that blocks that consume memory were not reached.

  2. Same for memory leak. It might just indicate that the right conditions were not reached.

However, if the opposite was true: if you app is steadily allocating more an more memory without releasing it, I would take that as a pretty good indication of a memory leak.

Upvotes: 2

Related Questions