java - Get current heap usage of app process -


i find out how memory android app using in order prevent outofmemoryexceptions. know can find out maximum memory 1 application can use calling runtime.maxmemory(); - , on devices pretty low (24mb), memory issue game.

when call runtime.totalmemory() in oncreate() method before starting game engine, ~23mb - , calling after starting game engine , after loading bunch of (small) bitmaps memory, ~25mb heap usage. it's possible 2mb difference usage of gameengine (it's still version), i'm not 100% sure.

nevertheless, memory usage exceed maxmemory limit of low memory android devices. i'm pretty sure parts of application runtime not actively created application (e.g. shared libraries) not count maxmemory limit; apparently count totalmemory stat.

so how can know sure how memory app uses , still has before maxmemory limit reached?
runtime.freememory() doesn't either.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -