问题
AFAIK android assigns heap limit based on
OEM
or Screen resolution of device andRAM
it self. ex: samsung s5 128mb is limit. How to get current memory usage in android?Whereas the android Profiler shows that my app is eating more memory than > 128.
OutOfMemory
Line 160185: 12-08 11:22:18.332 I/art (11728): Alloc partial concurrent mark sweep GC freed 0(0B) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 2.012ms total 240.841ms
Line 160325: 12-08 11:22:18.652 I/art (11728): Clamp target GC heap from 143MB to 128MB
Line 160327: 12-08 11:22:18.652 I/art (11728): Alloc concurrent mark sweep GC freed 0(0B) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 2.378ms total 314.229ms
Line 160675: 12-08 11:22:19.102 I/art (11728): Clamp target GC heap from 143MB to 128MB
matches the 128mb limit
Queries:
a. Hows to relate Profiler Memory
vs Java API
heap memory used?
b. Is it Profiler java memory
== Java API
heap memory used as above #1.
c. How to relate Profiler Memory
vs Java API
heap memory used vs Device settings memory usage by an app?
d. Is it possible to know JavaScript(Cordova based webview app)
, native level
heap usage?
Thanks
Nithin
来源:https://stackoverflow.com/questions/47714637/android-profiler-vs-java-api-level-memory-calculation