Simulate low memory on a real Android device

I have a problem with application widgets on Android KitKat 4.4.2, that is, the OS removes my background launch of the service without restarting, albeit in a sticky mode.

Now I have found a trick to use onTaskRemoved to restart my service in case of low memory conditions.

But now the problem is how to simulate the low memory state on my device, and not on the emulator?

+4
source share
1 answer

I think you can use your own C code for this. Here is what I will do:

  • C, , , .
  • Linux, "-static". Android Linux , libc, , .
  • adb .
  • .

, , . , , , " ".

0

All Articles