How do I prevent an app from force closing due to low memory I have a floating application (a paint pad) which "floats as a window" in the foreground, while other apps are running. 

However, when I open some large applications, it is force closed. 

What I tried? 


Rooted my os
I made it a system app
I added an exception to a memory cleaner (that comes default with miui) 


Still it force closes. 


  How do I reserve some memory to it so that it wouldn't force close automatically?
Open the apk as a zip file and view the AndroidManifest.xml ... Find the line

package="com.paint.app"


What is your package name ?

Once you have the package name....


Open System Folder 
Open Build.prop as a text document
Add the following code, With 1 blank line at the bottom of the manifest - Important to add the blank line ! otherwise you'll boot loop !

sys.keep_app_1=com.paint.app


You can also add more apps to keep in memory by adding another line 

sys.keep_app_2=com.painter.app