4

I need to output my android application RAM consumption in runtime. I an using Java. I need method on java, which will return current RAM consumption of my application.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • 1
    Please explain, in precise technical terms, what you mean by "current memory usage of my application". IOW, what exactly are you trying to debug? – CommonsWare Aug 23 '17 at 14:55
  • I'm trying to debug RAM usage. – Anatoly Ruymkin Aug 23 '17 at 14:57
  • 1
    Please explain, in precise technical terms, what you mean by "RAM usage". After all, you say that you need to "output Ram usage info on device screen". You are going to need to explain to users what this "Ram usage info" is. If you cannot explain to a programmer what this means, how are you going to explain to users what this means? – CommonsWare Aug 23 '17 at 15:01
  • I mean the amount of RAM that my application consumes. – Anatoly Ruymkin Aug 23 '17 at 15:09
  • 1
    https://stackoverflow.com/questions/3170691/how-to-get-current-memory-usage-in-android/19267315#19267315 – CommonsWare Aug 23 '17 at 15:19
  • Possible duplicate of [How to get current memory usage in android?](https://stackoverflow.com/questions/3170691/how-to-get-current-memory-usage-in-android) – Josef Adamcik Aug 23 '17 at 15:38
  • https://stackoverflow.com/questions/2298208/how-do-i-discover-memory-usage-of-my-application-in-android – Anatoly Ruymkin Aug 24 '17 at 09:27

1 Answers1

0

Simplest way is to use Memory monitor in Android studio, when your device is connected to your pc

Pein
  • 1,059
  • 3
  • 10
  • 31
  • I know that. But I need to output Ram usage info on device screen. – Anatoly Ruymkin Aug 23 '17 at 14:59
  • 1
    Why? This smacks of an X-Y problem... what is it that makes you believe it needs to be on the device screen rather than through Android Studio? You may need to take a step back and explain in more detail the original problem you're trying to solve (the one you think displaying "_RAM usage on device screen_" will help to solve). – TripeHound Aug 23 '17 at 15:03
  • 1
    Well, I can imaging numerous QA specialists testing the app on different hardware and monitoring current memory consumption with no clue what Android Studio is. Sounds legit. – romaroma Aug 24 '17 at 04:48
  • @romaroma I don't think any one saying there _can't_ be a legitimate reason for wanting this, but the OP really needs to provide more detail about precisely what they want and why, otherwise people are just guessing. Even the term "RAM usage" can have several meanings; without more details, what the OP means by it may not match what potential suggestions mean. – TripeHound Aug 24 '17 at 09:52