I'm also awared of this problem in my app, which will run out of
memory after changing screen orientation for several times.
However, when I tried to create a whole new android application, the
problem persists.
Here is the code which is created by eclipse plugin. I just added the
getInstanceCount() in onDestroy:
package com.android.orienttest;
import android.app.Activity;
import android.os.Bundle;
public class orienttest extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
public void onDestroy()
{
System.gc();
long ref = getInstanceCount();
super.onDestroy();
}
}
ref will increase each time i press Ctrl+F11 to change the orientation
of the screen.
# dumpsys meminfo -A 12 com.android.orienttest
dumpsys meminfo -A 12 com.android.orienttest
Currently running services:
meminfo
----------------------------------------------------------
DUMP OF SERVICE meminfo:
Applications Memory Usage (kB):
Uptime: 2027592 Realtime: 2027594
** MEMINFO in pid 1088 [com.android.orienttest] **
native dalvik other total
size: 2752 3207 N/A 5959
allocated: 2689 2486 N/A 5175
free: 62 721 N/A 783
(Pss): 997 1446 1451 3894
(shared dirty): 1068 3816 576 5460
(priv dirty): 892 1088 1052 3032
Objects
Views: 98 ViewRoots: 1
AppContexts: 15 Activities: 14
Assets: 2 AssetManagers: 2
Local Binders: 6 Proxy Binders: 11
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 0 dbFiles: 0
numPagers: 0 inactivePageKB: 0
activePageKB: 0
We can see that the Activities has grown up to 14 after the test,
which should be 1 theoretically.
I'm currently using android sdk 1.5 r1.
Please someone give me the hint?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---