Log Cat Running Continuously - android

I am getting infinite number of lines in the log cat. Even if i am not running the program, the messages are getting displayed infinitely. I even reopened the eclipse.
But, I dont know, what is the reason. The memory in my C drive is 1.7 gb left. I hope this wont be a problem. Can you please tell me what the error could be.
This is the verbose logcat.
Log Cat Error :
DCD ON
DCD ON
DCD ON
D/Tethering(373): interfaceLinkStateChanged wlan0, true
interfaceStatusChanged wlan0, true
DCD ON
DCD ON
E/AlarmManagerService(373): android_server_AlarmManagerService_set to type=3, 248683.937000000
V/AlarmManager(373): waitForAlarm result :8
V/AlarmManager(373): ClockReceiver onReceive() ACTION_TIME_TICK
E/AlarmManagerService(373): android_server_AlarmManagerService_set to type=3, 248542.915000000
W/AlarmManager(373): FACTORY_ON= 0
D/STATUSBAR-Clock(492): onReceive() - ACTION_TIME_TICK
D/ClockWidget(373): refreshTime()
TTS Message = It is 9 : 30 AM, Monday, February 24
DCD ON
D/BatteryService(373): update start
level:100 scale:100 status:5 health:2 present:true voltage: 4313 temperature: 230 technology: Li-ion AC powered:false USB powered:true icon:17303181 invalid charger:0
02-24 09:30:04.331: D/ThermistorObserver(373): mBatteryBRForAMOLED : onReceive() : newTemperature : 230
updateLocked, mLastBroadcastState =0 , oldAction = null
D/STATUSBAR-BatteryController(492): onReceive() - ACTION_BATTERY_CHANGED
onReceive() - level:100
onReceive() - plugged:2
D/STATUSBAR-BatteryController(492): onReceive() - BATTERY_STATUS_FULL:
D/BatteryService(373): turn on LED for fully charged
D/STATUSBAR-PhoneStatusBar(492): ACTION_BATTERY_CHANGED
D/STATUSBAR-PhoneStatusBar(492): NORMAL_BATTERY
D/PowerUI(492): getBatteryOnline : battery online file not found
E/SMD(105): DCD ON
I took a some lines from log cat and displayed it.
I am not running alarm manager anywhere. I have not used it anywhere.

You can filter the logcat messages using this statement in the filter textbox:
tag:MyTag
or
app:com.myapplicationpackage

I think these are the logs because you have set alarm in your device and for all the other basic apps that your device has by default. :)

Those logs are probably sent by the System..
Add a filter from the LogCat options so that you only see logs from a particular application or tag.. You can filter logs on the basis of type (i.e. error, warning, debug etc), Package name of your application, Tag of the log (the tag that you send in Log.d or Log.e etc) and even a regex.
Take a look at this answer for more details:
Filter tags in LogCat (in Android Eclipse Plug-In)

Related

HMS ASR cannot start recording

I'm trying to add HMS automatic speech recognition (ASR) to my app. I already have SpeechRecognizer implemented, but it requires GMS to work.
The current HMS implementation works on a non-huawei device with HMS core installed, but does not work on my Huawei Mediapad T5.
Things I've tried
The methods are called from different threads (main thread and graphics thread), so I've tried synchronizing the methods on a lock or posting a Runnable to the activity handler, without making much a difference. I.E., wrapping the functions in synchronized(lock) or activity.post.
Code:
fun init(activity: Activity)
speechRecognizer = MLAsrRecognizer.createAsrRecognizer(activity)
speechIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
.putExtra(
MLAsrCaptureConstants.LANGUAGE,
"en-US"
)
.putExtra(MLAsrConstants.FEATURE, MLAsrConstants.FEATURE_ALLINONE)
speechRecognizer?.setAsrListener(listener)
fun startListening()
speechRecognizer?.startRecognizing(speechIntent)
fun destroy()
speechRecognizer?.destroy()
Logs
4945-4945 W/HmsSpeechRecognitionHolder#c1cafe: init on Thread[main,5,main]
4945-4945 W/InputMethodManager: startInputReason = 1
4945-4945 W/HmsSpeechRecognitionHolder#c1cafe: startListening on Thread[main,5,main]
4945-4945 E/HaLogProvider: forbiddenHiLog openHa = false
4945-4945 E/HaLogProvider: forbiddenHiLog.getVenderCountry=ca
4945-4945 E/HaLogProvider: forbiddenHiLog openHa = false
4945-4945 E/MLASR_HaAdapter_MLKitAsr: mEventsToBeReported: has no response event isInfoGatherStart:falsemsg: 0
4945-4945 E/HwCustAudioRecordImpl: isOpenEC : false
634-985 E/HuaweiProcessing: ProcessingLib_Create: the algo have already been created.
634-985 W/EffectsFactory: EffectCreate() library huawei_processing: could not create fx Huawei Audio Preprocessing Effect, error -22
634-985 E/EffectFactoryHAL: Error creating effect e707d040-6b79-11e2-b16a-0002a5d5c51b: Invalid argument
721-8060 E/AudioEffect: set(): AudioFlinger could not create effect, status: -19
721-8060 W/AudioPolicyEffects: addInputEffects(): failed to create Fx huawei_pre_processing on source 1
634-8049 E/baidu_asr_interface: asr_baidu_set_parameters_data-not baidu asr
634-7993 W/DeviceHAL: Device 0x78c2d00000 get_mic_mute: Function not implemented
634-987 W/DeviceHAL: Device 0x78c2dc4680 get_mic_mute: Function not implemented
721-8009 W/HuaweiAudioFlinger: soundtrigger is now disable or not support, pls enable it first from setting
721-8009 W/APM_AudioPolicyManager: startInput(78) failed: other input 70 already started
721-8009 E/AudioFlinger: RecordThread::start error,setCallingAppName -1
4945-4945 E/AudioRecord: start() status -38
4945-4945 E/MLASR_A: getVendorCountry=ca
500-8480 W/libc: Set property "hw.wifi.dns_stat" to "99,14,14044,1,34759"
1472-1472 W/HwKeyguardDragHelper: AnimationBlocked
4945-5079 W/libEGL: EGLNativeWindowType 0x79e0317010 disconnect failed
1140-2290 E/WindowManager: win=Window{d80c651 u0 ProjectActivity} destroySurfaces: appStopped=true win.mWindowRemovalAllowed=false win.mRemoveOnExit=false
767-767 E/wificond: Failed to get NL80211_RATE_INFO_NOISE
767-767 E/wificond: Failed to get NL80211_RATE_INFO_SNR
767-767 E/wificond: Failed to get NL80211_STA_INFO_CNAHLOAD
1140-1316 E/WificondControl: Noise: 0, Snr: -1, Chload: -1
767-767 E/wificond: Failed to get NL80211_RATE_INFO_SNR
767-767 E/wificond: Failed to get NL80211_STA_INFO_CNAHLOAD
767-767 E/wificond: Failed to get NL80211_RATE_INFO_NOISE
767-767 E/wificond: Failed to get NL80211_RATE_INFO_SNR
767-767 E/wificond: Failed to get NL80211_STA_INFO_CNAHLOAD
1140-1316 E/WificondControl: Noise: 0, Snr: -1, Chload: -1
761-8466 W/ACodec: forcing OMX state to Idle when received shutdown in ExecutingState
769-8467 W/SimpleSoftOMXComponent: onChangeState mState= 3, mTargetState = 3, state = 2
769-8467 W/SimpleSoftOMXComponent: checkTransitions port buf count is not zero
769-1826 W/SimpleSoftOMXComponent: checkTransitions port buf count is not zero
769-1826 W/SimpleSoftOMXComponent: checkTransitions port buf count is not zero
769-1826 W/SimpleSoftOMXComponent: checkTransitions port buf count is not zero
769-1826 W/SimpleSoftOMXComponent: checkTransitions port buf count is not zero
769-1826 W/SimpleSoftOMXComponent: checkTransitions mState = 2, mTargetState = 1
721-8060 W/HuaweiAudioFlinger: soundtrigger is now disable or not support, pls enable it first from setting
1900-3437 E/HSM: BMNCaller:is not PermissionEnabled.
721-6695 W/AudioFlinger::EffectModule: EffectModule 0x7ba4f22a00 destructor called with unreleased interface
634-941 E/audio_hw_primary: in_remove_audio_effect error effect is null
634-941 W/StreamHAL: Error from HAL stream in function remove_audio_effect: Function not implemented
721-6695 E/AudioFlinger::EffectModule: Error when removing effect: -38
721-6695 W/AudioFlinger::EffectHandle: disconnect Effect handle 0x7ba4e45800 disconnected after thread destruction
1640-1796 W/AudioState: session release and not found sessionId: 81
4945-4945 W/HmsSpeechRecognitionHolder#c1cafe: destroy on Thread[main,5,main]
4945-8481 E/HwCustAudioRecordImpl: isOpenEC : false
4945-8481 E/HwCustAudioRecordImpl: isOpenEC : false
Things I found suspicious in the logs
634-985 E/HuaweiProcessing: ProcessingLib_Create: the algo have already been created.
634-985 W/EffectsFactory: EffectCreate() library huawei_processing: could not create fx Huawei Audio Preprocessing Effect, error -22
634-985 E/EffectFactoryHAL: Error creating effect e707d040-6b79-11e2-b16a-0002a5d5c51b: Invalid argument
721-8060 E/AudioEffect: set(): AudioFlinger could not create effect, status: -19
721-8060 W/AudioPolicyEffects: addInputEffects(): failed to create Fx huawei_pre_processing on source 1
721-8009 W/APM_AudioPolicyManager: startInput(78) failed: other input 70 already started
721-8009 E/AudioFlinger: RecordThread::start error,setCallingAppName -1
4945-4945 E/AudioRecord: start() status -38
Note: the HMS demo apps I've tried works correctly on my Mediapad T5.
Update: After some fixes pointed out by #shirley, ASR seems to be working reliably on a P30Lite. But still facing the same issue on an older Mediapad T5.
According to the logs you provided, the voice of the user is not detected.
The meanings of logs and status codes are as follows:
solution
It is recommended that you add logs to the callback method of the MLAsrListener listener to view the speech recognition process.
You are advised to check mSpeechRecognizer.destroy(). Check whether this method is invoked prematurely and has ended before it starts.
Check whether the device is faulty or whether the microphone of the device is invalid. Replace the device and perform the test.
After reviewing your logs, the following errors were found:
The reason for this error is:The Languagecode for speech recognition exceeds 10.
You can view the code here:
Ensure that the speech recognition Languagecode does not exceed 10.
11203 ,subError code: 3002,errorMessage: Service unavailable
The cause of this error is that the app_id information is not found in the project.
You are advised to check whether the agconnect-services.json file exists in the project, as shown in the following
If the file does not exist, you need to add it to the project. If the file exists, ensure that app_id is correct.
For details, see the following Docs.
Check whether Automatic Speech Recognition fails to be enabled.
If Automatic Speech Recognition fails to be enabled, you can obtain the cause by using the onError(int error, String errorMessage) method of the MLAsrListener class, as shown in the following figure.
You can add the above method to the listener's class:
2.If speech recognition is enabled successfully but the speech recognition result is not obtained:
The MLAsrConstants.FEATURE parameter is set to FUNCTION_ALLINONE. Therefore, you need to obtain the speech recognition result in the onResults(Bundle results) method, as shown in the following figure.
Some models of phones and tablets could have resource limitation issues when using the ML ASR. The symptom of the problem is that the phone/tablet does not respond after the microphone button is clicked, or an error message is displayed indicating that the speech recognition service is not installed on the device. Not only HMS ASR, I tried using native Android SpeechRecognizer to implement speech recognition and the sample app hangs after click on the button on a limited hardware resource phone simulator.
To fix your issue, I would suggest to switch using the HMS ML Kit ASR to using HMS ML Kit Real-Time Transcription (RTT). RTT provides similar features as ASR for speech recognition and convert the speech to text. For more details, see the HMS ML Kit RTT document at ML Kit-Real-Time Transcription (huawei.com).
The code for RTT is similar to ASR, you need to provide a SpeechRecognitionListener class or anonymous class to implements MLSpeechRealTimeTranscriptionListener. And there is sample code at the document link too. I tested the sample code on my Huawei phone Mate 30 Pro and it is working just fine.

Media volume either 0% or 100%

I have a custom android AOSP ROM with a peculiar problem: The volume can only be set to either 0% or 100%. As a result, the volume buttons just turn the sound on or off. If I use the volume slider instead, and the volume is not muted, it jumps immediately to 100%. The volume is not reduced even momentarily.
Interestingly, the volume for ringtones and alarms is not affected and can be set as usual.
The problem occurs via headphones, internal speakers, and HDMI out.
I tried setprop ro.config.media_vol_steps 30, and that does work in that it changes the number of volume steps in the slider - but it does not affect the output volume. I found nothing in logcat, this is the only suspicious thing (I set the volume via slider to a low value):
02-08 06:18:43.117 1813 2298 V audio_hw_primary: out_set_parameters: routing=1024
02-08 06:18:43.670 22493 22493 I vol.Events: writeEvent touch_level_changed STREAM_MUSIC 3
02-08 06:18:44.127 22493 22493 I vol.Events: writeEvent touch_level_done STREAM_MUSIC 3
02-08 06:18:46.575 22493 22493 I vol.Events: writeEvent dismiss_dialog touch_outside
02-08 06:18:46.581 22493 24066 I vol.Events: writeEvent active_stream_changed UNKNOWN_STREAM_-1
02-08 06:18:46.695 1813 2298 V audio_hw_primary: out_set_parameters: routing=1024
02-08 06:18:49.842 1813 2298 D audio_hw_primary: out_standby
What could cause this? E.g. does the hardware report the current volume back to the UI (then it could be a driver problem)?
In your ROM, a fixed-volume (full) is set. Its a resource configuration. Usually done for HDMI devices.

Android alarm is 12 hours late

I have set an alarm (in an alarm clock app we are developing) for 8:58 (in 24h format).
The alarm did not fire - alarm icon is still in status bar - and when I write adb shell dumpsys alarm I can see this:
Batch{6b33bdb num=1 start=99803288 end=99803288 flgs=0x3}:
RTC_WAKEUP #0: Alarm{3e3da2e type 0 when 1484078280736 my.app}
tag=*walarm*:my.app/md5f98255d9820be5cc9672d0645bf1ca12.RingBroadcastReceiver
type=0 whenElapsed=+11h1m53s125ms when=2017-01-10 20:58:00
window=0 repeatInterval=0 count=0 flags=0x3
Alarm clock:
triggerTime=2017-01-10 08:58:00
showIntent=PendingIntent{21219cf: PendingIntentRecord{aac3f5c my.app startActivity}}
operation=PendingIntent{ecde88f: PendingIntentRecord{821c71c my.app broadcastIntent}}
Next wake from idle: Alarm{3e3da2e type 0 when 1484078280736 my.app}
tag=*walarm*:my.app/md5f98255d9820be5cc9672d0645bf1ca12.RingBroadcastReceiver
type=0 whenElapsed=+11h1m53s125ms when=2017-01-10 20:58:00
window=0 repeatInterval=0 count=0 flags=0x3
Alarm clock:
triggerTime=2017-01-10 08:58:00
showIntent=PendingIntent{21219cf: PendingIntentRecord{aac3f5c my.app startActivity}}
operation=PendingIntent{ecde88f: PendingIntentRecord{821c71c my.app broadcastIntent}}
THE QUESTION IS: How is it possible that when is 12 hours after triggerTime?
It seems like 12/24 hour format issue, but my device and also my app and its time picker are all set to 24 hour format. This issue happened just once. When I set a new alarm, it works as expected.
Any ideas?
UPDATE:
We are using this code to set the alarm (sorry for Xamarin syntax) and I have tested that the alarmEntity is returning correct time. The problem must be in this code or in the device/android/system stuff. From the triggerTime=2017-01-10 08:58:00 it seems to me that the code is OK and there is some issue in the system or alarm manager.
DateTime closestTrigger = alarmEntity.GetTime();
Calendar calendar = Calendar.Instance;
calendar.Set(CalendarField.Year, closestTrigger.Year);
calendar.Set(CalendarField.Month, closestTrigger.Month - 1);
calendar.Set(CalendarField.DayOfMonth, closestTrigger.Day);
calendar.Set(CalendarField.HourOfDay, closestTrigger.Hour);
calendar.Set(CalendarField.Minute, closestTrigger.Minute);
calendar.Set(CalendarField.Second, closestTrigger.Second);
var alarmInfo = new AlarmManager.AlarmClockInfo(calendar.TimeInMillis, mainPendingIntent);
manager.SetAlarmClock(alarmInfo, ringPendingIntent);
UPDATE 2:
I've found one more important line in the same dumpsys alarm log:
Next alarm clock information:
user:0 pendingSend:false time:1484035080736 = 2017-01-10 08:58:00 = -58m6s876ms
..which means the alarm was missed, but the system didn't even try to present it, the logcat didn't show any activity at all around the 8:58. And still not clear why would the system reschedule the alarm to 20:58.

android device Battery health showing overheat even though battery is in normal temperature

DUMP OF SERVICE batterystats:
Battery History (0% used, 1584 used of 256KB, 6 strings using 492):
0 (9) RESET:TIME: 2016-03-07-15-59-54
0 (2) 092 c2501424 status=not-charging health=overheat plug=none temp=373 volt=4030 +running +wake_lock +mobile_radio +audio +screen data_conn=hspa phone_signal_strength=great brightness=bright fg=1000:"com.catalina.logdump"
0 (2) 092 c2501424 top=u0a68:"com.honeywell.testtools.suspendresumetest"
0 (2) 092 c2501424 user=0:"0"
0 (2) 092 c2501424 userfg=0:"0"
+69ms (2) 092 c2501424 status=discharging
AS the battery temp=373, it is showing health=overheat, That should not happen at all. Because of this health=overheat device notification LED will blink in RED.
Can anybody give me solution please.
I got the error in the kernel as
1) <3>[18810.893554, 1] bq27000-battery bq27000-battery: error reading register 18: -1
2)<3>[19205.674407, 0] bq27000-battery bq27000-battery: error reading nominal available capacity
3) BatteryService: Battery Led Mode is null
Along with this I am attaching bugreport file.

Android app crashes with WIN DEATH after memory-intensive activity

Summary
I work on an Android app which, as one of its features, involves users marking up an image and saving it. This process involves some heavy canvas drawImage() calls (sometimes on an image around 12 MB+ uncompressed) as well as lots of encoding and decoding of data. The image data also cached in the Android file system and passed from Java to JavaScript through a JavaScriptInterface.
However, with an LG G Pad X8.3 running Android 5.0.2, we are getting lots of crashing. When it crashes, the log says "WIN DEATH" and it goes back to the home screen without showing any "Unfortunately, ___ has stopped" message. Our "WIN DEATH" is preceded by a win death of the InputMethod and before that a "WIN DEATH" of com.lge.launcher2.Launcher. It is intermittent, but frequent enough to be a big problem.
Details
(1) It seems to happen after the heavy image saving manipulation, but not immediately after
(2) It happens more often when the keyboard is brought up. Is something about bringing up the keyboard causing it to crash?
(3) When watching the memory usage in Android Studio as the app is running, nothing is too out of the ordinary. When it crashes, there is still free memory available in the graph.
(3) We tried using largeHeap in our manifest, but that did not eliminate the crashing.
(4) Memory usage is between 10 and 20 MB.
(5) I can add around 32 million numbers to a JavaScript array before the web view crashes. That's at least 240 MB (8 bytes per JS number). When it crashes, it shows a blank screen, as opposed to the crash I am trying to fix where it brings you back to the home screen.
(6) There is a well publicized memory leak (or a couple, actually) in this version of Android, but LG does not offer upgrades for this model.
(7) We have tried optimizing the code to use as little memory as possible, but the crashing remains.
(8) The crash logs always contain similar information around the crash.
02-08 12:13:01.642 1850-1850/? I/PhoneApp﹕ onTrimMemory: 5
02-08 12:13:01.642 1850-1850/? I/PhoneApp﹕ trim memory
02-08 12:13:01.652 945-965/? I/ActivityManager﹕ Process com.google.android.partnersetup (pid 23908) has died
02-08 12:13:01.682 945-16584/? I/ActivityManager﹕ Process com.google.android.apps.plus (pid 23756) has died
02-08 12:13:01.692 1850-1850/? I/PhoneApp﹕ onTrimMemory: 10
02-08 12:13:01.692 1850-1850/? I/PhoneApp﹕ trim memory
02-08 12:13:01.712 945-2088/? I/ActivityManager﹕ Process com.lge.p2p (pid 24102) has died
02-08 12:13:01.742 945-2041/? I/ActivityManager﹕ Process com.google.android.gms.wearable (pid 23833) has died
02-08 12:13:01.752 1850-1850/? I/PhoneApp﹕ onTrimMemory: 15
...
02-08 12:11:06.862 22936-22936/com.mycompany.ourapp W/IInputConnectionWrapper﹕ getTextBeforeCursor on inactive InputConnection
...
02-08 12:11:06.912 20890-20890/? D/Cliptray Manager﹕ isAvailable() UserHandle.myUserId() = 0, isOwner = true
02-08 12:11:06.912 1961-8134/? I/Cliptray Service﹕ Standard mode!! ClipTray is Supported!
02-08 12:11:06.912 1961-8134/? D/Cliptray Service﹕ isAvailable() mLastIsOwner = true
02-08 12:11:06.912 1961-8134/? I/Cliptray Service﹕ Owner!! ClipTray is Supported! mIsOwnerClipTray = true
02-08 12:11:06.912 1961-8134/? D/Cliptray Service﹕ ignore packageName : com.mycompany.ourapp
...
02-08 12:12:39.782 22936-22936/com.mycompany.ourapp I/Choreographer﹕ Skipped 35 frames! The application may be doing too much work on its main thread.
...
02-08 12:13:02.622 945-2086/? I/WindowState﹕ WIN DEATH: Window{8dce4a3 u0 com.lge.launcher2/com.lge.launcher2.Launcher}
...
02-08 12:13:02.872 945-1922/? I/WindowState﹕ WIN DEATH: Window{393167d2 u0 InputMethod}
...
02-08 12:13:03.052 1979-1979/? D/QC_RIL_OEM_HOOK﹕ The connection to the service got disconnected unexpectedly!
02-08 12:13:03.052 1961-1961/? D/QC_RIL_OEM_HOOK﹕ The connection to the service got disconnected unexpectedly!
02-08 12:13:03.052 1850-1850/? D/QC_RIL_OEM_HOOK﹕ The connection to the service got disconnected unexpectedly!
02-08 12:13:03.052 1850-1850/? D/QC_RIL_OEM_HOOK﹕ The connection to the service got disconnected unexpectedly!
02-08 12:13:03.072 945-945/? W/InputMethodManagerService﹕ Session failed to close due to remote exception
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:496)
at com.android.internal.view.IInputMethodSession$Stub$Proxy.finishSession(IInputMethodSession.java:305)
at com.android.server.InputMethodManagerService.finishSessionLocked(InputMethodManagerService.java:1463)
at com.android.server.InputMethodManagerService.clearClientSessionLocked(InputMethodManagerService.java:1454)
at com.android.server.InputMethodManagerService.clearCurMethodLocked(InputMethodManagerService.java:1480)
at com.android.server.InputMethodManagerService.onServiceDisconnected(InputMethodManagerService.java:1499)
at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:1391)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1405)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at com.android.server.SystemServer.run(SystemServer.java:302)
at com.android.server.SystemServer.main(SystemServer.java:203)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
...
02-08 12:13:03.132 945-2088/? I/ActivityManager﹕ Process com.google.process.gapps (pid 21317) has died
...
02-08 12:13:03.182 1405-1405/? D/LGKeyguardUnlockMethodController﹕ onTrustChanged with userId : 0 , getUserTrustIsManaged : false ,getUserHasTrust : false
...
02-08 12:13:03.452 362-1705/? V/AudioFlinger﹕ 22936 died, releasing its sessions
02-08 12:13:03.452 362-1705/? V/AudioFlinger﹕ pid 1850 # 0
02-08 12:13:03.452 362-1705/? V/AudioFlinger﹕ pid 22936 # 1
02-08 12:13:03.452 362-1705/? V/AudioFlinger﹕ removing entry for pid 22936 session 520
02-08 12:13:03.452 362-1705/? V/AudioFlinger﹕ purging stale effects
02-08 12:13:03.452 362-1705/? V/AudioFlinger﹕ remove track (4097) and delete from mixer
02-08 12:13:03.452 945-2086/? I/WindowState﹕ WIN DEATH: Window{3eafa2d1 u0 com.mycompany.ourapp/com.mycompany.ourapp.MainActivity}
The memory leak that may be partially responsible: https://code.google.com/p/android/issues/detail?id=79729
Question
What could be causing the app to crash in this way? Is it a memory issue? is anything in the log output that I've copied here relevant?
Has anyone else had this problem and solved it? Is the Android 5.0.x/1.x memory leak bug responsible?
I wish I could be more specific, but the code is proprietary and the problem isn't (or hasn't yet been) localized to any one particular code sample. If more information is needed about a particular issue, please ask.
Update
I've noticed that there are a bunch of Choreographer messages in the logs about it doing too much work, but they are relatively small frame skips (~ 35 frames) and the last message occurs a full 20 seconds before the app crashed.
Update 2-10-16
We are now trying to reuse canvas objects in case they are not garbage collected, and we are also calling System.gc() when onTrimMemory is called with TRIM_MEMORY_RUNNING_LOW. This seems to have reduced the crashing to some degree, but still frequently enough to be concerning. Most of all, I would like to understand why it seems to randomly use up too much memory and crash. I've added the onTrimMemory lines to the log output below, which show it going from low to critical in a span of 100 ms. If this only happened when actually performing the memory-intensive actions, that would make sense, but it happens sometimes long after the user process has finished.
Pulling my hair out over here, trying to get a HTML Canvas based application running in CrossWalk on a Fire TV Stick. The app would run fine then crash after 30 minutes of use with this error. I was able to fix it but my use case is pretty specific, either way it may help folks who show up here later.
TL;DR: Reduce the size of textures being loaded into and out of the GPU.
I had a fullscreen canvas element running PixiJS, working essentially as a slideshow. The problem came from a single slide type, where large images with transparency would animate over a fixed background. After logging the CPU/GPU usage in Chrome's timeline feature I could see that the textures were being loaded into and out of the GPU all the time to accomplish the affect. Ultimately, I was able to resolve the issue by completely removing the background image element from canvas, and just displaying it in a div behind the canvas. The affect was identical, but the performance was improved significantly and this problem disappeared afterwards.
You are dealing with large bitmaps and loading all of them at run
time. You have to deal very carefully with large bitmaps by loading
the size that you need not the whole bitmap at once and then do
scaling.
Huge JavaScript Cause This
Given that you are working with limited memory, ideally you only want to load a lower resolution version in memory. The lower resolution version should match the size of the UI component that displays it. An image with a higher resolution does not provide any visible benefit, but still takes up precious memory and incurs additional performance overhead due to additional on the fly scaling.
Please check Managing Bitmap Memory.
You are using lots of canvas at once that's why this problem .
This used to happen with me, even after i used the large heap attribute in application manifest and it stopped to happen when i reset all the variable to null after finishing using them.
I don`t know your code but i would advise you to re-use the same variables and make sure you clean up after every operation and when done, because keeping in the memory large unused files is not good.

Categories

Resources