Keeping an app in memory
You can do it according to this post on XDA:


  
  Make a file called 99applock.txt
  Insert code below and put you messaging service in where it says PPID (that usually can be found in data/data if your using
  aftermakrket sms app) remove the .txt extension and put file in
  ect/init.d and just give it 777 permissions, it works for me.
  


    #!/system/bin/sh

    sleep 60

    PPID=$(pidof com.your.app)
    echo "-17" &gt; /proc/$PPID/oom_adj
    renice -18 $PPID