stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
02/09/13 12:24 PM (12 years ago)

Red in LogCat, yet it runs fine

Have an app which every now and then in the logcat will come up with these red lines: 02-09 14:20:37.699: E/WindowManager(300): Activity com.pedsophandroid.BT_activity_root has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@461c2070 that was originally added here 02-09 14:20:37.699: E/WindowManager(300): android.view.WindowLeaked: Activity com.pedsophandroid.BT_activity_root has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@461c2070 that was originally added here 02-09 14:20:37.699: E/WindowManager(300): at android.view.ViewRoot.<init>(ViewRoot.java:247) 02-09 14:20:37.699: E/WindowManager(300): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148) 02-09 14:20:37.699: E/WindowManager(300): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 02-09 14:20:37.699: E/WindowManager(300): at android.view.Window$LocalWindowManager.addView(Window.java:424) 02-09 14:20:37.699: E/WindowManager(300): at android.app.Dialog.show(Dialog.java:241) 02-09 14:20:37.699: E/WindowManager(300): at com.pedsophandroid.BT_activity_root.showAlert(BT_activity_root.java:151) 02-09 14:20:37.699: E/WindowManager(300): at com.pedsophandroid.BT_activity_root$3.run(BT_activity_root.java:470) even though it continues to run and run correctly. Do I have to worry? Steve
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/09/13 01:22 PM (12 years ago)
Possibly - you have a memory leak going on, which basically means memory is not being released properly when the item using it is no longer in use. This can lead your app to run out of memory and therefore crash. Android only allocates a few megabytes of memory to each app (16 I think), so any type of memory leak can become problematic.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
02/09/13 01:25 PM (12 years ago)
I echo what @chris1 just posted. It will let your App run just fine, but eventually it will crash because of this leak, which is memory. LA
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
02/09/13 01:48 PM (12 years ago)
How does one fix something like this? Steve
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/09/13 01:54 PM (12 years ago)
now that is a good question - there's a lot of answers to that and none are easy to follow for beginners to Android. This is probably the biggest problem I have with Android compared to iOS.
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
02/09/13 01:56 PM (12 years ago)
The app is a relatively simple one. I have not put any Javascript in myself. All BT created. Is this a minor but in the way BT compiles Android? Steve
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/09/13 02:04 PM (12 years ago)
What plugin are you using when this message occurs?
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
02/09/13 02:07 PM (12 years ago)
It seems to occur right after references to the splash screen. Steve
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/09/13 02:26 PM (12 years ago)
What plugin are you transitioning to after the splash?
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
02/09/13 02:42 PM (12 years ago)
After that I go to a menu with buttons. I deleted the log and can't get it to it again yet. AM getting a few of these red guys instead now: 02-09 16:27:29.479: E/KeyLayoutMap(141): mapKeypadKeyScancode - scancode=158 Steve
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/09/13 02:44 PM (12 years ago)
Hmm - not sure what that is. Maybe someone else does. I know others have said they had issues with that plugin on Android before though.
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
02/09/13 03:03 PM (12 years ago)
Yep I have a memory leak somewhat similar to yours, havent sorted it out yet. I have a splash screen , and menu with image, and some html docs, maps and call screeens, no code changes, crashes on everything.
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
02/09/13 03:27 PM (12 years ago)
Worse comes to worse I can get rid of the splash screen if you guys think that may be the culprit. Steve
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.