I'd like to perform the memory test of my android package.
In my package, there is only one very simple service.
The service is started only by bindService from another package. (not startService)
After, another package (package 1) calls bindService to my package, the package termintates. Then the log of my package is as follows.
04-04 16:13:06.962 5468-5468/memorytestapp I/: @onCreate
04-04 16:13:06.966 5468-5468/memorytestapp I/: @onBind
04-04 16:13:12.221 5468-5468/memorytestapp I/: @onUnbind
04-04 16:13:12.258 5468-5468/memorytestapp I/: @onDestroy
After onDestroy is called, I expect that my package do not resides in RAM after certain time.
However, even though the package 1 (caller) do not resides in RAM right after the termination, my packagee (callee) still resides in RAM continuously.
After 3 hours, when I enter the 'adb sehll dumpsys activity oom | grep my package name' to check the memory status, it shows this line.
Proc # 5: cch B/ /CEM trm: 0 5468:memorytestapp/u0a227 (cch-empty)
Although my package is in cached status, it still resides in RAM continuously. Even when I insert the code "stopService or stopSelf" at onDestroy, it has same status!
I really want my package not to reside in RAM after onDestroy is called.
Is there any opinion or comment to this situation??
Sincerely, Logan.
Source code of my package is as follows.
public class TestService extends Service {
@Override
public void onCreate(){
super.onCreate();
}
@Override
public void onDestroy(){
super.onDestroy();
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public boolean onUnbind(Intent intent) {
return true;
}
@Override
public void onRebind(Intent arg0){
}
}