Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cause onLowMemory on device for tests

I want to test our app for low memory cases.

Do you have any ideas, how to cause onLowMemory on devices?

Thank you.

like image 787
Tima Avatar asked Oct 06 '11 11:10

Tima


1 Answers

I just know only one way to do, which is to create a method running in a different thread that does memory leak, make it loop continuously until onLowMemory() is called, then stop the thread.

It's nice if anyone shares experiences on this case!

like image 147
Pete Houston Avatar answered Sep 30 '22 19:09

Pete Houston