Android - 当ActivityManager重新启动后台系统服务调度时,前台Activity被杀死

发布于 2024-12-11 07:42:05 字数 19947 浏览 0 评论 0原文

我有一个查看器应用程序,使用 Android 兼容包中的 ImageViewViewPager 实现。对于每个页面,我渲染一些 Bitmap 并将它们放入 ViewPager 中。它工作正常,但有时应用程序只是崩溃,没有异常,也没有寄存器转储。我注意到,通常情况下,应用程序不会崩溃,只是记录许多 GC 消息。但是当系统ActivityManager开始安排重启某些后台系统Service时,应用程序在页面之间切换时很有可能崩溃。

我搜索了一些问题,但都是关于 Service 由于内存不足而被终止,由于状态不一致而重新启动失败,或者其他什么。但就我而言,前台 Activity 被杀死,只是因为某些系统服务被安排重新启动。前台 Activity 怎么可能被“后台服务”杀死?

虽然在日志中,服务似乎因内存不足而重新启动失败,但我的活动只是被杀死,没有出现 OutOfMemoryError 错误。我不知道导致我的应用程序被杀死的真正问题是什么......

PS。如果我不在页面之间切换,应用程序将存活,但系统会重复安排重新启动服务。在这种情况下,应用程序在页面之间切换时很容易崩溃。

PS2。设备是:ASUS Transformer TF101,Android 3.2,内核版本:2.6.36.3-00003-g9baf8f7

这是日志,mycompany.viewer.MagazineActivity 是主要 Activity:

10-21 15:18:47.260: INFO/ActivityManager(135): Process com.google.android.apps.maps:NetworkLocationService (pid 14583) has died.
10-21 15:18:47.260: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.apps.maps/com.google.android.location.internal.server.NetworkLocationService in 56367ms
10-21 15:18:47.260: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.360: INFO/ActivityManager(135): Process com.google.android.music (pid 14500) has died.
10-21 15:18:47.360: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.music/.dl.DownloadManager$DownloadManagerService in 66267ms
10-21 15:18:47.360: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.560: INFO/ActivityManager(135): Process android.process.media (pid 14482) has died.
10-21 15:18:47.560: WARN/ActivityManager(135): Scheduling restart of crashed service com.android.providers.media/.MtpService in 76067ms
10-21 15:18:47.560: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.660: INFO/ActivityManager(135): Process net.smart.appstore.client (pid 14610) has died.
10-21 15:18:47.660: WARN/ActivityManager(135): Scheduling restart of crashed service net.smart.appstore.client/.service.LogSenderService in 85969ms
10-21 15:18:47.660: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.760: INFO/ActivityManager(135): Process com.asus.keyboard (pid 14617) has died.
10-21 15:18:47.760: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.keyboard/.KeyboardService in 95868ms
10-21 15:18:47.760: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.830: INFO/ActivityManager(135): Process com.asus.DLNA (pid 14634) has died.
10-21 15:18:47.830: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/.MusicPlaybackService in 105803ms
10-21 15:18:47.830: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:48.230: DEBUG/dalvikvm(14526): GC_FOR_ALLOC freed 431K, 31% free 19826K/28615K, paused 23ms
10-21 15:18:52.480: DEBUG/dalvikvm(14526): GC_CONCURRENT freed 1293K, 29% free 20566K/28615K, paused 2ms+3ms
10-21 15:18:52.840: DEBUG/skia(14526): purging 213K from font cache [14 entries]
10-21 15:18:52.870: DEBUG/dalvikvm(14526): GC_EXPLICIT freed 378K, 30% free 20189K/28615K, paused 2ms+3ms
10-21 15:18:53.640: INFO/ActivityManager(135): Start proc com.asus.DLNA for service com.asus.DLNA/com.asus.DMS.DLNAServerService: pid=14642 uid=10054 gids={3003, 1015}
10-21 15:18:53.690: INFO/DMS(14642):   ===========================>   onCreate()
10-21 15:18:54.040: INFO/ActivityManager(135): Process com.asus.DLNA (pid 14642) has died.
10-21 15:18:54.040: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/com.asus.DMS.DLNAServerService in 137364ms
10-21 15:18:54.040: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:54.770: INFO/ActivityManager(135): Process com.google.process.gapps (pid 25767) has died.
10-21 15:18:54.770: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.gsf/.gtalkservice.service.GTalkService in 108858ms
10-21 15:18:54.770: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.location/.NetworkLocationService in 118858ms
10-21 15:18:54.780: DEBUG/LocationProviderProxy(135): LocationProviderProxy.onServiceDisconnected ComponentInfo{com.google.android.location/com.google.android.location.NetworkLocationService}
10-21 15:18:54.780: DEBUG/GeocoderProxy(135): onServiceDisconnected ComponentInfo{com.google.android.location/com.google.android.location.NetworkLocationService}
10-21 15:18:54.780: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:55.430: ERROR/InputDispatcher(135): channel '4110db70 mycompany.viewer/mycompany.viewer.MagazineActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
10-21 15:18:55.430: ERROR/InputDispatcher(135): channel '4110db70 mycompany.viewer/mycompany.viewer.MagazineActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
10-21 15:18:55.430: INFO/ActivityManager(135): Process mycompany.viewer (pid 14526) has died.
10-21 15:18:55.440: INFO/WindowManager(135): WIN DEATH: Window{4110db70 mycompany.viewer/mycompany.viewer.MagazineActivity paused=false}
10-21 15:18:55.440: INFO/WindowManager(135): WINDOW DIED Window{4110db70 mycompany.viewer/mycompany.viewer.MagazineActivity paused=false}
10-21 15:18:55.470: INFO/ActivityManager(135): Start proc com.android.launcher for activity com.android.launcher/com.android.launcher2.Launcher: pid=14649 uid=10037 gids={}
10-21 15:18:55.470: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:55.660: DEBUG/dalvikvm(135): GC_EXPLICIT freed 875K, 22% free 26097K/33415K, paused 29ms+15ms
10-21 15:18:55.670: DEBUG/WindowManager(135): adjustConfigurationLw, config:{1.0 0mcc0mnc (no locale) sw800dp w1280dp h752dp xlrg land ?uimode ?night finger -keyb/v/h -nav/v} mLidOpen:-1 mHasDockFeature:true mHasHallSensorFeature:true config.hardKeyboardHidden:2
10-21 15:18:55.710: INFO/ActivityThread(14649): Pub com.android.launcher2.settings: com.android.launcher2.LauncherProvider
10-21 15:18:56.250: DEBUG/dalvikvm(14649): GC_FOR_ALLOC freed 132K, 4% free 6513K/6727K, paused 34ms
10-21 15:18:56.350: DEBUG/dalvikvm(14649): GC_CONCURRENT freed 40K, 2% free 6953K/7047K, paused 2ms+2ms
10-21 15:18:56.870: INFO/ActivityManager(135): Start proc com.asus.mygazine for broadcast com.asus.mygazine/.UtilsReceiver: pid=14659 uid=10027 gids={1015}
10-21 15:18:56.910: DEBUG/TabletStatusBar(186): lights on
10-21 15:18:56.940: DEBUG/dalvikvm(14649): GC_CONCURRENT freed 197K, 4% free 7231K/7495K, paused 6ms+2ms
10-21 15:18:56.960: DEBUG/dalvikvm(87): GC_EXPLICIT freed 11K, 5% free 6298K/6595K, paused 3ms+2ms
10-21 15:18:56.980: DEBUG/libEGL(14649): loaded /system/lib/egl/libGLES_android.so
10-21 15:18:57.000: DEBUG/dalvikvm(87): GC_EXPLICIT freed <1K, 5% free 6298K/6595K, paused 2ms+2ms
10-21 15:18:57.030: DEBUG/dalvikvm(87): GC_EXPLICIT freed <1K, 5% free 6298K/6595K, paused 2ms+3ms
10-21 15:18:57.060: DEBUG/libEGL(14649): loaded /system/lib/egl/libEGL_tegra.so
10-21 15:18:57.160: DEBUG/libEGL(14649): loaded /system/lib/egl/libGLESv1_CM_tegra.so
10-21 15:18:57.190: DEBUG/libEGL(14649): loaded /system/lib/egl/libGLESv2_tegra.so
10-21 15:18:57.240: DEBUG/OpenGLRenderer(14649): Creating OpenGL renderer caches
10-21 15:18:57.250: DEBUG/OpenGLRenderer(14649): Enabling debug mode 0
10-21 15:18:57.250: DEBUG/OpenGLRenderer(14649): Layers will be composited as regions
10-21 15:18:57.250: DEBUG/dalvikvm(14649): GC_CONCURRENT freed 252K, 5% free 7430K/7815K, paused 3ms+2ms
10-21 15:18:57.260: INFO/TextType(212): TextType = 0x0
10-21 15:18:57.260: WARN/InputManagerService(135): Got RemoteException sending setActive(false) notification to pid 14526 uid 10065

PS3。一些其他日志来描述崩溃进度

崩溃后,那些后台服务可以启动:

10-24 14:06:00.099: INFO/ActivityManager(135): Start proc com.asus.DLNA for service com.asus.DLNA/com.asus.DMS.DLNAServerService: pid=6482 uid=10054 gids={3003, 1015}
10-24 14:06:44.319: INFO/ActivityManager(135): Start proc com.android.bluetooth for service com.android.bluetooth/.pbap.BluetoothPbapService: pid=6495 uid=10061 gids={3003, 3002, 3001, 1015}
10-24 14:06:44.359: INFO/ActivityThread(6495): Pub com.android.bluetooth.opp: com.android.bluetooth.opp.BluetoothOppProvider
10-24 14:07:04.319: INFO/ActivityManager(135): Start proc com.rechild.advancedtaskkiller for service com.rechild.advancedtaskkiller/.BackService: pid=6502 uid=10077 gids={1007, 3003, 1015}
10-24 14:07:14.849: INFO/ActivityManager(135): Start proc android.process.acore for content provider com.android.providers.contacts/.ContactsProvider2: pid=6512 uid=10009 gids={3003, 1015}
10-24 14:07:14.889: INFO/ActivityThread(6512): Pub user_dictionary: com.android.providers.userdictionary.UserDictionaryProvider
10-24 14:07:14.899: INFO/ActivityThread(6512): Pub com.android.social: com.android.providers.contacts.SocialProvider
10-24 14:07:14.919: INFO/ActivityThread(6512): Pub applications: com.android.providers.applications.ApplicationsProvider
10-24 14:07:14.949: INFO/ActivityThread(6512): Pub contacts;com.android.contacts: com.android.providers.contacts.ContactsProvider2
10-24 14:07:14.959: INFO/ActivityThread(6512): Pub call_log: com.android.providers.contacts.CallLogProvider

再次打开查看器,加载一些页面,后台服务开始死亡,

10-24 14:08:22.269: INFO/ActivityManager(135): Process android.process.media (pid 6422) has died.
10-24 14:08:22.329: INFO/ActivityManager(135): Process com.asus.mygazine (pid 6385) has died.
10-24 14:08:22.429: INFO/ActivityManager(135): Process com.google.android.apps.maps:FriendService (pid 6460) has died.
10-24 14:08:22.529: INFO/ActivityManager(135): Process android.process.acore (pid 6512) has died.
10-24 14:08:22.539: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:33.839: INFO/ActivityManager(135): Process com.android.launcher (pid 6375) has died.
10-24 14:08:33.839: INFO/WindowManager(135): WIN DEATH: Window{40e07160 com.android.launcher/com.android.launcher2.Launcher paused=false}
10-24 14:08:33.839: INFO/ActivityManager(135): Low Memory: No more background processes.

并调度重新启动。

10-24 14:08:51.279: INFO/ActivityManager(135): Process com.google.android.music (pid 6398) has died.
10-24 14:08:51.279: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.music/.dl.DownloadManager$DownloadManagerService in 5000ms
10-24 14:08:51.279: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:51.369: INFO/ActivityManager(135): Process com.google.android.apps.maps:NetworkLocationService (pid 6452) has died.
10-24 14:08:51.369: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.apps.maps/com.google.android.location.internal.server.NetworkLocationService in 14904ms
10-24 14:08:51.369: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:51.469: INFO/ActivityManager(135): Process com.android.bluetooth (pid 6495) has died.
10-24 14:08:51.469: WARN/ActivityManager(135): Scheduling restart of crashed service com.android.bluetooth/.pbap.BluetoothPbapService in 24806ms
10-24 14:08:51.469: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:51.569: INFO/ActivityManager(135): Process com.asus.DLNA (pid 6482) has died.
10-24 14:08:51.569: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/.MusicPlaybackService in 34707ms
10-24 14:08:51.569: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/com.asus.DMS.DLNAServerService in 44707ms
10-24 14:08:51.569: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:51.669: INFO/ActivityManager(135): Process com.rechild.advancedtaskkiller (pid 6502) has died.
10-24 14:08:51.669: WARN/ActivityManager(135): Scheduling restart of crashed service com.rechild.advancedtaskkiller/.BackService in 54607ms
10-24 14:08:51.669: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:56.299: INFO/ActivityManager(135): Start proc com.google.android.music for service com.google.android.music/.dl.DownloadManager$DownloadManagerService: pid=6528 uid=10029 gids={3003, 1015}
10-24 14:08:56.409: INFO/ActivityThread(6528): Pub com.google.android.music.MusicContent: com.google.android.music.store.MusicContentProvider
10-24 14:08:56.439: INFO/MusicStore(6528): Database version: 31
10-24 14:08:56.439: WARN/AndroidMusic(6528): Need to wait for MusicPreferences to be created
10-24 14:08:56.639: WARN/AndroidMusic(6528): MusicPreferences still not made, creating on UI thread

有时,其中一些会成功启动。

10-24 14:09:16.299: INFO/ActivityManager(135): Start proc com.android.bluetooth for service com.android.bluetooth/.pbap.BluetoothPbapService: pid=6580 uid=10061 gids={3003, 3002, 3001, 1015}
10-24 14:09:16.329: INFO/ActivityThread(6580): Pub com.android.bluetooth.opp: com.android.bluetooth.opp.BluetoothOppProvider
10-24 14:09:26.309: INFO/ActivityManager(135): Start proc com.asus.DLNA for service com.asus.DLNA/.MusicPlaybackService: pid=6588 uid=10054 gids={3003, 1015}
10-24 14:09:36.289: INFO/DMS(6588):   ===========================>   onCreate()
10-24 14:09:46.299: INFO/ActivityManager(135): Start proc com.rechild.advancedtaskkiller for service com.rechild.advancedtaskkiller/.BackService: pid=6595 uid=10077 gids={1007, 3003, 1015}
10-24 14:09:56.299: INFO/ActivityManager(135): Start proc com.google.android.music for service com.google.android.music/.dl.DownloadManager$DownloadManagerService: pid=6602 uid=10029 gids={3003, 1015}
10-24 14:09:56.419: INFO/ActivityThread(6602): Pub com.google.android.music.MusicContent: com.google.android.music.store.MusicContentProvider
10-24 14:09:56.439: DEBUG/dalvikvm(6602): GC_CONCURRENT freed 165K, 4% free 6637K/6855K, paused 2ms+2ms
10-24 14:09:56.449: INFO/MusicStore(6602): Database version: 31
10-24 14:09:56.459: WARN/AndroidMusic(6602): Need to wait for MusicPreferences to be created
10-24 14:09:56.659: WARN/AndroidMusic(6602): MusicPreferences still not made, creating on UI thread
10-24 14:09:56.699: DEBUG/MusicPreferences(6602): New Active account: null
10-24 14:09:56.709: INFO/ActivityManager(135): Start proc android.process.media for content provider com.android.providers.media/.MediaProvider: pid=6616 uid=10031 gids={1015, 1023, 1024, 2001, 3003}
10-24 14:09:56.719: DEBUG/MusicStore(6602): Disabled WAL
10-24 14:09:56.719: DEBUG/MusicStore(6602): Database opened
10-24 14:09:56.739: INFO/ActivityThread(6616): Pub media: com.android.providers.media.MediaProvider
10-24 14:09:56.739: INFO/ActivityManager(135): Process com.google.android.apps.maps:NetworkLocationService (pid 6558) has died.
10-24 14:09:56.749: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.apps.maps/com.google.android.location.internal.server.NetworkLocationService in 5000ms
10-24 14:09:56.749: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:09:57.099: INFO/MediaProvider(6616): Update ID=1, mount=/system, isMounted=1, VID = -1
10-24 14:09:57.139: INFO/MediaProvider(6616): Update ID=2, mount=/data, isMounted=1, VID = -1
10-24 14:09:57.509: INFO/MediaProvider(6616): Update ID=1, mount=/mnt/sdcard, isMounted=1, VID = -1
10-24 14:09:57.529: INFO/ActivityThread(6616): Pub downloads: com.android.providers.downloads.DownloadProvider
10-24 14:09:57.539: INFO/ActivityThread(6616): Pub drm: com.android.providers.drm.DrmProvider

然后系统开始调度重启,有的成功,有的失败,如此反复。顺便说一句,com.google.android.music/.dl.DownloadManager$DownloadManagerServicecom.google.android.apps.maps/com.google.android.location.internal.server.NetworkLocationService总是重启失败。

日志看起来像是“调度重新启动...”、“启动进程...”、“GC ...”的混合,

如果我在页面之间切换,更多服务被杀死,系统仍然调度重复重新启动。

10-24 14:11:04.619: INFO/ActivityManager(135): Process com.android.bluetooth (pid 6763) has died.
10-24 14:11:04.619: WARN/ActivityManager(135): Scheduling restart of crashed service com.android.bluetooth/.pbap.BluetoothPbapService in 77800ms
10-24 14:11:04.619: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:11:04.729: INFO/ActivityManager(135): Process com.asus.DLNA (pid 6588) has died.
10-24 14:11:04.729: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/com.asus.DMS.DLNAServerService in 22273ms
10-24 14:11:04.729: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/.MusicPlaybackService in 32273ms
10-24 14:11:04.729: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:11:04.849: INFO/ActivityManager(135): Process com.rechild.advancedtaskkiller (pid 6595) has died.
10-24 14:11:04.849: WARN/ActivityManager(135): Scheduling restart of crashed service com.rechild.advancedtaskkiller/.BackService in 42147ms
10-24 14:11:04.849: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:11:05.959: INFO/ActivityManager(135): Process com.google.process.gapps (pid 6410) has died.
10-24 14:11:05.959: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.gsf/.gtalkservice.service.GTalkService in 51042ms
10-24 14:11:05.959: DEBUG/LocationProviderProxy(135): LocationProviderProxy.onServiceDisconnected ComponentInfo{com.google.android.location/com.google.android.location.NetworkLocationService}
10-24 14:11:05.959: DEBUG/GeocoderProxy(135): onServiceDisconnected ComponentInfo{com.google.android.location/com.google.android.location.NetworkLocationService}
10-24 14:11:05.959: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.location/.NetworkLocationService in 61042ms
10-24 14:11:05.959: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:11:06.079: DEBUG/dalvikvm(6438): GC_FOR_ALLOC freed 431K, 27% free 21267K/28871K, paused 23ms
10-24 14:11:07.009: INFO/ActivityManager(135): Start proc com.google.android.music for service com.google.android.music/.dl.DownloadManager$DownloadManagerService: pid=6771 uid=10029 gids={3003, 1015}
10-24 14:11:07.129: INFO/ActivityThread(6771): Pub com.google.android.music.MusicContent: com.google.android.music.store.MusicContentProvider
10-24 14:11:07.149: DEBUG/dalvikvm(6771): GC_CONCURRENT freed 145K, 2% free 6739K/6855K, paused 8ms+2ms
10-24 14:11:07.149: INFO/MusicStore(6771): Database version: 31
10-24 14:11:07.159: WARN/AndroidMusic(6771): Need to wait for MusicPreferences to be created
10-24 14:11:07.229: DEBUG/dalvikvm(6438): GC_CONCURRENT freed 1293K, 24% free 22006K/28871K, paused 2ms+4ms
10-24 14:11:07.359: WARN/AndroidMusic(6771): MusicPreferences still not made, creating on UI thread
10-24 14:11:07.369: INFO/ActivityManager(135): Start proc com.google.process.gapps for content provider com.google.android.gsf/.gservices.GservicesProvider: pid=6783 uid=10025 gids={3003, 1015, 2001, 1007}
10-24 14:11:07.419: INFO/ActivityThread(6783): Pub com.google.settings: com.google.android.gsf.settings.GoogleSettingsProvider
10-24 14:11:07.419: INFO/ActivityThread(6783): Pub subscribedfeeds: com.google.android.gsf.subscribedfeeds.SubscribedFeedsProvider
10-24 14:11:07.439: INFO/ActivityThread(6783): Pub com.google.contacts.gal.provider: com.google.android.syncadapters.contacts.GalProvider
10-24 14:11:07.449: INFO/ActivityThread(6783): Pub com.google.android.gsf.gservices: com.google.android.gsf.gservices.GservicesProvider
10-24 14:11:07.449: INFO/GservicesProvider(6783): Gservices pushing to system: true; secure: true
10-24 14:11:07.449: INFO/ActivityThread(6783): Pub com.google.android.providers.talk: com.google.android.gsf.talk.TalkProvider

又切换了一些页面,最后应用程序崩溃了,正如最上面的日志一样。

I have a viewer application, implement with ImageView and ViewPager from Android Compatibility Package. For each page, I render some Bitmap and put them into ViewPager. It works fine, but sometimes the application just crashed without exception nor register dump. I noticed that, normally, the application didn't crash, just log many GC messages. But when system ActivityManager start to schedule restart some background system Service, the application get a big chance to crash when switching between pages.

I searched some questions, but they are about Service being killed because of low memory, restart failed because of state inconsistency, or something. But in my case, It's foreground Activity being killed, just because some system Services were scheduled restart. How could a foreground Activity being killed "by background Service"?

Although in log, the Services seem to restart failed because of low memory, but my Activity just being killed without OutOfMemoryError. I can't figure out what is the real problem caused my application being killed...

PS. If I don't switch between pages, the application lives, but system is scheduling restart Services repeatedly. In this situation, the application is easy to crash when switching between pages.

PS2. device is: ASUS Transformer TF101, Android 3.2, Kernel version: 2.6.36.3-00003-g9baf8f7

Here is the log, mycompany.viewer.MagazineActivity is the main Activity:

10-21 15:18:47.260: INFO/ActivityManager(135): Process com.google.android.apps.maps:NetworkLocationService (pid 14583) has died.
10-21 15:18:47.260: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.apps.maps/com.google.android.location.internal.server.NetworkLocationService in 56367ms
10-21 15:18:47.260: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.360: INFO/ActivityManager(135): Process com.google.android.music (pid 14500) has died.
10-21 15:18:47.360: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.music/.dl.DownloadManager$DownloadManagerService in 66267ms
10-21 15:18:47.360: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.560: INFO/ActivityManager(135): Process android.process.media (pid 14482) has died.
10-21 15:18:47.560: WARN/ActivityManager(135): Scheduling restart of crashed service com.android.providers.media/.MtpService in 76067ms
10-21 15:18:47.560: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.660: INFO/ActivityManager(135): Process net.smart.appstore.client (pid 14610) has died.
10-21 15:18:47.660: WARN/ActivityManager(135): Scheduling restart of crashed service net.smart.appstore.client/.service.LogSenderService in 85969ms
10-21 15:18:47.660: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.760: INFO/ActivityManager(135): Process com.asus.keyboard (pid 14617) has died.
10-21 15:18:47.760: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.keyboard/.KeyboardService in 95868ms
10-21 15:18:47.760: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:47.830: INFO/ActivityManager(135): Process com.asus.DLNA (pid 14634) has died.
10-21 15:18:47.830: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/.MusicPlaybackService in 105803ms
10-21 15:18:47.830: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:48.230: DEBUG/dalvikvm(14526): GC_FOR_ALLOC freed 431K, 31% free 19826K/28615K, paused 23ms
10-21 15:18:52.480: DEBUG/dalvikvm(14526): GC_CONCURRENT freed 1293K, 29% free 20566K/28615K, paused 2ms+3ms
10-21 15:18:52.840: DEBUG/skia(14526): purging 213K from font cache [14 entries]
10-21 15:18:52.870: DEBUG/dalvikvm(14526): GC_EXPLICIT freed 378K, 30% free 20189K/28615K, paused 2ms+3ms
10-21 15:18:53.640: INFO/ActivityManager(135): Start proc com.asus.DLNA for service com.asus.DLNA/com.asus.DMS.DLNAServerService: pid=14642 uid=10054 gids={3003, 1015}
10-21 15:18:53.690: INFO/DMS(14642):   ===========================>   onCreate()
10-21 15:18:54.040: INFO/ActivityManager(135): Process com.asus.DLNA (pid 14642) has died.
10-21 15:18:54.040: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/com.asus.DMS.DLNAServerService in 137364ms
10-21 15:18:54.040: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:54.770: INFO/ActivityManager(135): Process com.google.process.gapps (pid 25767) has died.
10-21 15:18:54.770: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.gsf/.gtalkservice.service.GTalkService in 108858ms
10-21 15:18:54.770: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.location/.NetworkLocationService in 118858ms
10-21 15:18:54.780: DEBUG/LocationProviderProxy(135): LocationProviderProxy.onServiceDisconnected ComponentInfo{com.google.android.location/com.google.android.location.NetworkLocationService}
10-21 15:18:54.780: DEBUG/GeocoderProxy(135): onServiceDisconnected ComponentInfo{com.google.android.location/com.google.android.location.NetworkLocationService}
10-21 15:18:54.780: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:55.430: ERROR/InputDispatcher(135): channel '4110db70 mycompany.viewer/mycompany.viewer.MagazineActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
10-21 15:18:55.430: ERROR/InputDispatcher(135): channel '4110db70 mycompany.viewer/mycompany.viewer.MagazineActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
10-21 15:18:55.430: INFO/ActivityManager(135): Process mycompany.viewer (pid 14526) has died.
10-21 15:18:55.440: INFO/WindowManager(135): WIN DEATH: Window{4110db70 mycompany.viewer/mycompany.viewer.MagazineActivity paused=false}
10-21 15:18:55.440: INFO/WindowManager(135): WINDOW DIED Window{4110db70 mycompany.viewer/mycompany.viewer.MagazineActivity paused=false}
10-21 15:18:55.470: INFO/ActivityManager(135): Start proc com.android.launcher for activity com.android.launcher/com.android.launcher2.Launcher: pid=14649 uid=10037 gids={}
10-21 15:18:55.470: INFO/ActivityManager(135): Low Memory: No more background processes.
10-21 15:18:55.660: DEBUG/dalvikvm(135): GC_EXPLICIT freed 875K, 22% free 26097K/33415K, paused 29ms+15ms
10-21 15:18:55.670: DEBUG/WindowManager(135): adjustConfigurationLw, config:{1.0 0mcc0mnc (no locale) sw800dp w1280dp h752dp xlrg land ?uimode ?night finger -keyb/v/h -nav/v} mLidOpen:-1 mHasDockFeature:true mHasHallSensorFeature:true config.hardKeyboardHidden:2
10-21 15:18:55.710: INFO/ActivityThread(14649): Pub com.android.launcher2.settings: com.android.launcher2.LauncherProvider
10-21 15:18:56.250: DEBUG/dalvikvm(14649): GC_FOR_ALLOC freed 132K, 4% free 6513K/6727K, paused 34ms
10-21 15:18:56.350: DEBUG/dalvikvm(14649): GC_CONCURRENT freed 40K, 2% free 6953K/7047K, paused 2ms+2ms
10-21 15:18:56.870: INFO/ActivityManager(135): Start proc com.asus.mygazine for broadcast com.asus.mygazine/.UtilsReceiver: pid=14659 uid=10027 gids={1015}
10-21 15:18:56.910: DEBUG/TabletStatusBar(186): lights on
10-21 15:18:56.940: DEBUG/dalvikvm(14649): GC_CONCURRENT freed 197K, 4% free 7231K/7495K, paused 6ms+2ms
10-21 15:18:56.960: DEBUG/dalvikvm(87): GC_EXPLICIT freed 11K, 5% free 6298K/6595K, paused 3ms+2ms
10-21 15:18:56.980: DEBUG/libEGL(14649): loaded /system/lib/egl/libGLES_android.so
10-21 15:18:57.000: DEBUG/dalvikvm(87): GC_EXPLICIT freed <1K, 5% free 6298K/6595K, paused 2ms+2ms
10-21 15:18:57.030: DEBUG/dalvikvm(87): GC_EXPLICIT freed <1K, 5% free 6298K/6595K, paused 2ms+3ms
10-21 15:18:57.060: DEBUG/libEGL(14649): loaded /system/lib/egl/libEGL_tegra.so
10-21 15:18:57.160: DEBUG/libEGL(14649): loaded /system/lib/egl/libGLESv1_CM_tegra.so
10-21 15:18:57.190: DEBUG/libEGL(14649): loaded /system/lib/egl/libGLESv2_tegra.so
10-21 15:18:57.240: DEBUG/OpenGLRenderer(14649): Creating OpenGL renderer caches
10-21 15:18:57.250: DEBUG/OpenGLRenderer(14649): Enabling debug mode 0
10-21 15:18:57.250: DEBUG/OpenGLRenderer(14649): Layers will be composited as regions
10-21 15:18:57.250: DEBUG/dalvikvm(14649): GC_CONCURRENT freed 252K, 5% free 7430K/7815K, paused 3ms+2ms
10-21 15:18:57.260: INFO/TextType(212): TextType = 0x0
10-21 15:18:57.260: WARN/InputManagerService(135): Got RemoteException sending setActive(false) notification to pid 14526 uid 10065

PS3. some other log to describe the crash progress

After crash, those background services can start:

10-24 14:06:00.099: INFO/ActivityManager(135): Start proc com.asus.DLNA for service com.asus.DLNA/com.asus.DMS.DLNAServerService: pid=6482 uid=10054 gids={3003, 1015}
10-24 14:06:44.319: INFO/ActivityManager(135): Start proc com.android.bluetooth for service com.android.bluetooth/.pbap.BluetoothPbapService: pid=6495 uid=10061 gids={3003, 3002, 3001, 1015}
10-24 14:06:44.359: INFO/ActivityThread(6495): Pub com.android.bluetooth.opp: com.android.bluetooth.opp.BluetoothOppProvider
10-24 14:07:04.319: INFO/ActivityManager(135): Start proc com.rechild.advancedtaskkiller for service com.rechild.advancedtaskkiller/.BackService: pid=6502 uid=10077 gids={1007, 3003, 1015}
10-24 14:07:14.849: INFO/ActivityManager(135): Start proc android.process.acore for content provider com.android.providers.contacts/.ContactsProvider2: pid=6512 uid=10009 gids={3003, 1015}
10-24 14:07:14.889: INFO/ActivityThread(6512): Pub user_dictionary: com.android.providers.userdictionary.UserDictionaryProvider
10-24 14:07:14.899: INFO/ActivityThread(6512): Pub com.android.social: com.android.providers.contacts.SocialProvider
10-24 14:07:14.919: INFO/ActivityThread(6512): Pub applications: com.android.providers.applications.ApplicationsProvider
10-24 14:07:14.949: INFO/ActivityThread(6512): Pub contacts;com.android.contacts: com.android.providers.contacts.ContactsProvider2
10-24 14:07:14.959: INFO/ActivityThread(6512): Pub call_log: com.android.providers.contacts.CallLogProvider

Open the viewer again, load some pages, background services begin to die,

10-24 14:08:22.269: INFO/ActivityManager(135): Process android.process.media (pid 6422) has died.
10-24 14:08:22.329: INFO/ActivityManager(135): Process com.asus.mygazine (pid 6385) has died.
10-24 14:08:22.429: INFO/ActivityManager(135): Process com.google.android.apps.maps:FriendService (pid 6460) has died.
10-24 14:08:22.529: INFO/ActivityManager(135): Process android.process.acore (pid 6512) has died.
10-24 14:08:22.539: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:33.839: INFO/ActivityManager(135): Process com.android.launcher (pid 6375) has died.
10-24 14:08:33.839: INFO/WindowManager(135): WIN DEATH: Window{40e07160 com.android.launcher/com.android.launcher2.Launcher paused=false}
10-24 14:08:33.839: INFO/ActivityManager(135): Low Memory: No more background processes.

and scheduling restart.

10-24 14:08:51.279: INFO/ActivityManager(135): Process com.google.android.music (pid 6398) has died.
10-24 14:08:51.279: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.music/.dl.DownloadManager$DownloadManagerService in 5000ms
10-24 14:08:51.279: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:51.369: INFO/ActivityManager(135): Process com.google.android.apps.maps:NetworkLocationService (pid 6452) has died.
10-24 14:08:51.369: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.apps.maps/com.google.android.location.internal.server.NetworkLocationService in 14904ms
10-24 14:08:51.369: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:51.469: INFO/ActivityManager(135): Process com.android.bluetooth (pid 6495) has died.
10-24 14:08:51.469: WARN/ActivityManager(135): Scheduling restart of crashed service com.android.bluetooth/.pbap.BluetoothPbapService in 24806ms
10-24 14:08:51.469: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:51.569: INFO/ActivityManager(135): Process com.asus.DLNA (pid 6482) has died.
10-24 14:08:51.569: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/.MusicPlaybackService in 34707ms
10-24 14:08:51.569: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/com.asus.DMS.DLNAServerService in 44707ms
10-24 14:08:51.569: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:51.669: INFO/ActivityManager(135): Process com.rechild.advancedtaskkiller (pid 6502) has died.
10-24 14:08:51.669: WARN/ActivityManager(135): Scheduling restart of crashed service com.rechild.advancedtaskkiller/.BackService in 54607ms
10-24 14:08:51.669: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:08:56.299: INFO/ActivityManager(135): Start proc com.google.android.music for service com.google.android.music/.dl.DownloadManager$DownloadManagerService: pid=6528 uid=10029 gids={3003, 1015}
10-24 14:08:56.409: INFO/ActivityThread(6528): Pub com.google.android.music.MusicContent: com.google.android.music.store.MusicContentProvider
10-24 14:08:56.439: INFO/MusicStore(6528): Database version: 31
10-24 14:08:56.439: WARN/AndroidMusic(6528): Need to wait for MusicPreferences to be created
10-24 14:08:56.639: WARN/AndroidMusic(6528): MusicPreferences still not made, creating on UI thread

Sometimes, some of them would start successfully.

10-24 14:09:16.299: INFO/ActivityManager(135): Start proc com.android.bluetooth for service com.android.bluetooth/.pbap.BluetoothPbapService: pid=6580 uid=10061 gids={3003, 3002, 3001, 1015}
10-24 14:09:16.329: INFO/ActivityThread(6580): Pub com.android.bluetooth.opp: com.android.bluetooth.opp.BluetoothOppProvider
10-24 14:09:26.309: INFO/ActivityManager(135): Start proc com.asus.DLNA for service com.asus.DLNA/.MusicPlaybackService: pid=6588 uid=10054 gids={3003, 1015}
10-24 14:09:36.289: INFO/DMS(6588):   ===========================>   onCreate()
10-24 14:09:46.299: INFO/ActivityManager(135): Start proc com.rechild.advancedtaskkiller for service com.rechild.advancedtaskkiller/.BackService: pid=6595 uid=10077 gids={1007, 3003, 1015}
10-24 14:09:56.299: INFO/ActivityManager(135): Start proc com.google.android.music for service com.google.android.music/.dl.DownloadManager$DownloadManagerService: pid=6602 uid=10029 gids={3003, 1015}
10-24 14:09:56.419: INFO/ActivityThread(6602): Pub com.google.android.music.MusicContent: com.google.android.music.store.MusicContentProvider
10-24 14:09:56.439: DEBUG/dalvikvm(6602): GC_CONCURRENT freed 165K, 4% free 6637K/6855K, paused 2ms+2ms
10-24 14:09:56.449: INFO/MusicStore(6602): Database version: 31
10-24 14:09:56.459: WARN/AndroidMusic(6602): Need to wait for MusicPreferences to be created
10-24 14:09:56.659: WARN/AndroidMusic(6602): MusicPreferences still not made, creating on UI thread
10-24 14:09:56.699: DEBUG/MusicPreferences(6602): New Active account: null
10-24 14:09:56.709: INFO/ActivityManager(135): Start proc android.process.media for content provider com.android.providers.media/.MediaProvider: pid=6616 uid=10031 gids={1015, 1023, 1024, 2001, 3003}
10-24 14:09:56.719: DEBUG/MusicStore(6602): Disabled WAL
10-24 14:09:56.719: DEBUG/MusicStore(6602): Database opened
10-24 14:09:56.739: INFO/ActivityThread(6616): Pub media: com.android.providers.media.MediaProvider
10-24 14:09:56.739: INFO/ActivityManager(135): Process com.google.android.apps.maps:NetworkLocationService (pid 6558) has died.
10-24 14:09:56.749: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.apps.maps/com.google.android.location.internal.server.NetworkLocationService in 5000ms
10-24 14:09:56.749: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:09:57.099: INFO/MediaProvider(6616): Update ID=1, mount=/system, isMounted=1, VID = -1
10-24 14:09:57.139: INFO/MediaProvider(6616): Update ID=2, mount=/data, isMounted=1, VID = -1
10-24 14:09:57.509: INFO/MediaProvider(6616): Update ID=1, mount=/mnt/sdcard, isMounted=1, VID = -1
10-24 14:09:57.529: INFO/ActivityThread(6616): Pub downloads: com.android.providers.downloads.DownloadProvider
10-24 14:09:57.539: INFO/ActivityThread(6616): Pub drm: com.android.providers.drm.DrmProvider

Then the system begins to scheduling restart, success some, failed some, repeatedly. Btw, com.google.android.music/.dl.DownloadManager$DownloadManagerService and com.google.android.apps.maps/com.google.android.location.internal.server.NetworkLocationService always failed to restart.

Log looks like mix of "Scheduling restart...", "Start proc...", "GC ..."

If I switch between pages, more Services are killed, system still scheduling restart repeatedly.

10-24 14:11:04.619: INFO/ActivityManager(135): Process com.android.bluetooth (pid 6763) has died.
10-24 14:11:04.619: WARN/ActivityManager(135): Scheduling restart of crashed service com.android.bluetooth/.pbap.BluetoothPbapService in 77800ms
10-24 14:11:04.619: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:11:04.729: INFO/ActivityManager(135): Process com.asus.DLNA (pid 6588) has died.
10-24 14:11:04.729: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/com.asus.DMS.DLNAServerService in 22273ms
10-24 14:11:04.729: WARN/ActivityManager(135): Scheduling restart of crashed service com.asus.DLNA/.MusicPlaybackService in 32273ms
10-24 14:11:04.729: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:11:04.849: INFO/ActivityManager(135): Process com.rechild.advancedtaskkiller (pid 6595) has died.
10-24 14:11:04.849: WARN/ActivityManager(135): Scheduling restart of crashed service com.rechild.advancedtaskkiller/.BackService in 42147ms
10-24 14:11:04.849: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:11:05.959: INFO/ActivityManager(135): Process com.google.process.gapps (pid 6410) has died.
10-24 14:11:05.959: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.gsf/.gtalkservice.service.GTalkService in 51042ms
10-24 14:11:05.959: DEBUG/LocationProviderProxy(135): LocationProviderProxy.onServiceDisconnected ComponentInfo{com.google.android.location/com.google.android.location.NetworkLocationService}
10-24 14:11:05.959: DEBUG/GeocoderProxy(135): onServiceDisconnected ComponentInfo{com.google.android.location/com.google.android.location.NetworkLocationService}
10-24 14:11:05.959: WARN/ActivityManager(135): Scheduling restart of crashed service com.google.android.location/.NetworkLocationService in 61042ms
10-24 14:11:05.959: INFO/ActivityManager(135): Low Memory: No more background processes.
10-24 14:11:06.079: DEBUG/dalvikvm(6438): GC_FOR_ALLOC freed 431K, 27% free 21267K/28871K, paused 23ms
10-24 14:11:07.009: INFO/ActivityManager(135): Start proc com.google.android.music for service com.google.android.music/.dl.DownloadManager$DownloadManagerService: pid=6771 uid=10029 gids={3003, 1015}
10-24 14:11:07.129: INFO/ActivityThread(6771): Pub com.google.android.music.MusicContent: com.google.android.music.store.MusicContentProvider
10-24 14:11:07.149: DEBUG/dalvikvm(6771): GC_CONCURRENT freed 145K, 2% free 6739K/6855K, paused 8ms+2ms
10-24 14:11:07.149: INFO/MusicStore(6771): Database version: 31
10-24 14:11:07.159: WARN/AndroidMusic(6771): Need to wait for MusicPreferences to be created
10-24 14:11:07.229: DEBUG/dalvikvm(6438): GC_CONCURRENT freed 1293K, 24% free 22006K/28871K, paused 2ms+4ms
10-24 14:11:07.359: WARN/AndroidMusic(6771): MusicPreferences still not made, creating on UI thread
10-24 14:11:07.369: INFO/ActivityManager(135): Start proc com.google.process.gapps for content provider com.google.android.gsf/.gservices.GservicesProvider: pid=6783 uid=10025 gids={3003, 1015, 2001, 1007}
10-24 14:11:07.419: INFO/ActivityThread(6783): Pub com.google.settings: com.google.android.gsf.settings.GoogleSettingsProvider
10-24 14:11:07.419: INFO/ActivityThread(6783): Pub subscribedfeeds: com.google.android.gsf.subscribedfeeds.SubscribedFeedsProvider
10-24 14:11:07.439: INFO/ActivityThread(6783): Pub com.google.contacts.gal.provider: com.google.android.syncadapters.contacts.GalProvider
10-24 14:11:07.449: INFO/ActivityThread(6783): Pub com.google.android.gsf.gservices: com.google.android.gsf.gservices.GservicesProvider
10-24 14:11:07.449: INFO/GservicesProvider(6783): Gservices pushing to system: true; secure: true
10-24 14:11:07.449: INFO/ActivityThread(6783): Pub com.google.android.providers.talk: com.google.android.gsf.talk.TalkProvider

Switching some more pages, finally, the application crashed, as the top most log.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文