2

I have a Scenario in that I need to increase the RAM usage of the phone programmatically.

I don't know whether it is possible. If so please help me on this.

Somnath Muluk
  • 55,015
  • 38
  • 216
  • 226
Sudarshan
  • 1,291
  • 3
  • 26
  • 35
  • increase the RAM usage? Do you mean you fill up the RAM with junk data? – Raptor Jun 11 '12 at 06:52
  • Hi Shivan, Yes , exactly i need to fill up the RAM with junk data or some app,but the usage should be just above the threshold level Thanks Mr.Peter and Awais for ur reply – Sudarshan Jun 11 '12 at 08:23

3 Answers3

0

I assume you don't want to just waste memory, but what to know how to increase the maximum.

Normally you set the maximum. This is the largest value you would want the heap to be or exit the program. If you set it high enough, you would never need to increase it.

If you want the application to exit with less memory than this, you can just check the usage and exit the program. (Though I can't think why you would)

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
0

Check out This StackOverFlow Page.

This page has Prevent out of Memory Exception.

Think Opposite.

Community
  • 1
  • 1
reinhard.lee
  • 503
  • 4
  • 10
  • 24
  • @reinhard.lee..Sir in the above link he had mentioned that he was relaunching the app..But in my case i need to start filling the ram memory wen i launch my app till a particular value i.e, slightly above the RAM MEMORY Threshold value.. – Sudarshan Jun 15 '12 at 06:17
  • @reinhard.lee..Sir basically i need to fill up the ram memory wen my app is launched..i had idea that we can buffer a video which use ram mem..but it is not wrkng..there is no change in the usage of the memory – Sudarshan Jun 15 '12 at 06:38
  • @user1448299 Why don't you try running the various applications? it's not working neither? App Run -> Press Home key -> another App Run – reinhard.lee Jun 15 '12 at 07:00
  • @reinhard.lee..No sir i got a scenario like this to do..basically i need to do stress test like stuff,,for that we have 2 scenarios/environment 1) based on lowering the battery level and test , 2)Increase the Ram Memory and Internal Memory usage and test...Now currently we need 2 set up an environment like above points and den do stress test an app.. – Sudarshan Jun 15 '12 at 09:05
-1

We can increase Ram usage through Native Side of Android.. We can make an Single Application to use more than 300Mb of Ram. Since the OUT OF MEMORY exception is only for the Java Side (SDK) but not for the C side(NDK).. But in Android Memory management, if the system memory (as a whole) goes down a threshold value it will automatically kill application which uses more memory to re-gain memory..

Sudarshan
  • 1,291
  • 3
  • 26
  • 35