Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.OutOfMemoryError in android #5059

Open
AutumnSun1996 opened this issue Feb 25, 2025 · 3 comments
Open

java.lang.OutOfMemoryError in android #5059

AutumnSun1996 opened this issue Feb 25, 2025 · 3 comments
Labels
bug Something isn't working question Further information is requested

Comments

@AutumnSun1996
Copy link

Home Assistant Android app version(s):
2025.1.2-full

Android version(s):
15

Device model(s):
Redmi K70 Ultra

Home Assistant version:
Core 2025.2.2
Frontend 20250210.0

Last working Home Assistant release (if known):
not sure

Description of problem, include YAML if issue is related to notifications:
System reports frequent crash of app, occurs several times every day.

Companion App Logs:

Timestamp: 2025-02-25 11:17:02.729
Thread: DefaultDispatcher-worker-48
Exception: java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 1640864 free bytes and 1602KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
	at java.lang.String.fastSubstring(Native Method)
	at java.lang.String.substring(String.java:2538)
	at android.database.DatabaseUtils.getSqlStatementPrefixExtendedNoRegex(DatabaseUtils.java:1674)
	at android.database.DatabaseUtils.getSqlStatementTypeExtended(DatabaseUtils.java:1723)
	at android.database.DatabaseUtils.getSqlStatementType(DatabaseUtils.java:1764)
	at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:735)
	at android.database.sqlite.SQLiteSession.beginTransactionUnchecked(SQLiteSession.java:332)
	at android.database.sqlite.SQLiteSession.beginTransaction(SQLiteSession.java:311)
	at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:819)
	at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:802)
	at android.database.sqlite.SQLiteDatabase.beginTransactionNonExclusive(SQLiteDatabase.java:677)
	at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.beginTransactionNonExclusive(FrameworkSQLiteDatabase.kt:59)
	at androidx.room.RoomDatabase.internalBeginTransaction(RoomDatabase.kt:527)
	at androidx.room.RoomDatabase.beginTransaction(RoomDatabase.kt:511)
	at io.homeassistant.companion.android.database.sensor.SensorDao_Impl.getAnyIsEnabled(SensorDao_Impl.java:418)
	at io.homeassistant.companion.android.common.sensors.SensorManager$DefaultImpls.isEnabled(SensorManager.kt:110)
	at io.homeassistant.companion.android.common.sensors.AudioSensorManager.isEnabled(AudioSensorManager.kt:12)
	at io.homeassistant.companion.android.common.sensors.AudioSensorManager.updateAudioSensor(AudioSensorManager.kt:194)
	at io.homeassistant.companion.android.common.sensors.AudioSensorManager.requestSensorUpdate(AudioSensorManager.kt:175)
	at io.homeassistant.companion.android.common.sensors.SensorManager$DefaultImpls.requestSensorUpdate(SensorManager.kt:145)
	at io.homeassistant.companion.android.common.sensors.AudioSensorManager.requestSensorUpdate(AudioSensorManager.kt:12)
	at io.homeassistant.companion.android.common.sensors.SensorReceiverBase.updateSensors(SensorReceiverBase.kt:185)
	at io.homeassistant.companion.android.common.sensors.SensorReceiverBase$onReceive$3.invokeSuspend(SensorReceiverBase.kt:155)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@2b6f4e2, Dispatchers.IO]

Screenshot or video of problem:

Image

Additional information:

@AutumnSun1996 AutumnSun1996 added the bug Something isn't working label Feb 25, 2025
@AutumnSun1996
Copy link
Author

Just installed 2025.2.5-full, will check if it still happens.

@jpelgrom
Copy link
Member

Do you ever have the app crash on you while using it because of this?

The stacktrace you posted probably is unrelated, just the reason the system decided it was out of memory but it doesn't tell a lot about what is using the memory. If you are able to get OOM logs from the system which include more details (using logcat), that would be helpful.

growth limit 268435456

That's not a lot of memory for the app (~268 MB), especially if it has a WebView open or cached. This may be a device specific issue we cannot fix.

@jpelgrom jpelgrom added the question Further information is requested label Mar 1, 2025
@AutumnSun1996
Copy link
Author

Thanks for your reply.

Do you ever have the app crash on you while using it because of this?

It only happens when app is background.

Here is some logs from Show and Share Logs: https://wormhole.app/AYyoo0#cvmlqAZ2rWoU4EawW7s4DA
I get it after crash, and there are some ' E ' lines, but seems not relevant, too.

As for logcat, I will try it when I have more time to debug this problem

Samples from Show and Share Logs:

--------- beginning of main
03-03 15:22:09.741 5359 5359 I mpanion.android: Using CollectorTypeCC GC.
03-03 15:22:09.742 5359 5359 E mpanion.android: Not starting debugger since process cannot load the jdwp agent.
03-03 15:22:09.745 5359 5359 D nativeloader: Load libframework-connectivity-tiramisu-jni.so using APEX ns com_android_tethering for caller /apex/com.android.tethering/javalib/framework-connectivity-t.jar: ok
03-03 15:22:09.746 5359 5359 I MessageMonitor: Load libmiui_runtime
--------- beginning of system

03-03 15:22:09.913 5359 12320 E chromium: [0303/152209.913248:ERROR:variations_seed_loader.cc(39)] Seed missing signature.

03-03 15:22:09.952 5359 12337 D libMEOW : meow reload overlay cfg path: na
03-03 15:22:09.952 5359 12337 W QT : qt_process_init() called
03-03 15:22:09.952 5359 12337 E QT : [QT]file does not exist
03-03 15:22:09.952 5359 12337 W QT : Support!!
03-03 15:22:09.952 5359 12337 E QT : [QT]file does not exist
03-03 15:22:09.952 5359 12337 D libMEOW : applied 1 plugins for [io.homeassistant.companion.android]:

03-03 15:22:09.989 5359 12362 D ViewContentFactory: createInterceptor took 0ms
03-03 15:22:09.989 5359 12362 E ContentCatcherManager: failed to get ContentCatcherService.
03-03 15:22:09.989 5359 12335 I PowerHalWrapper: PowerHalWrapper.getInstance
03-03 15:22:09.989 5359 12362 E ContentCatcherManager: failed to get ContentCatcherService.
03-03 15:22:09.990 5359 12362 I ContentCatcher: SettingTrigger : register screen QA status observer io.homeassistant.companion.android.launch.LaunchActivity
03-03 15:22:09.991 5359 12362 I ContentCatcher: SettingTrigger : register global collect status observer io.homeassistant.companion.android.launch.LaunchActivity
03-03 15:22:09.991 5359 5359 I SurfaceFactory: [static] sSurfaceFactory = com.mediatek.view.impl.SurfaceFactoryImpl@a5949ba
03-03 15:22:09.995 5359 5359 E MI-PreRender: init cloud whiteList failed
03-03 15:22:09.998 5359 12337 W libc : Access denied finding property "ro.vendor.display.iris_x7.support"
03-03 15:22:10.004 5359 5359 D VRI[LaunchActivity]: hardware acceleration = true, forceHwAccelerated = false

03-03 15:22:10.136 5359 12362 D ViewContentFactory: createInterceptor took 0ms
03-03 15:22:10.137 5359 12362 E ContentCatcherManager: failed to get ContentCatcherService.
03-03 15:22:10.137 5359 12362 E ContentCatcherManager: failed to get ContentCatcherService.
03-03 15:22:10.142 5359 5359 I cr_CombinedPProvider: #registerProvider() provider:WV.C8@c3d2747 isPolicyCacheEnabled:false policyProvidersSize:0

03-03 15:22:10.148 5359 5359 I cr_CombinedPProvider: #flushPolicies()
03-03 15:22:10.179 5359 12441 E chromium: [ERROR:simple_file_enumerator.cc(58)] Could not get file info for /data/user/0/io.homeassistant.companion.android/cache/WebView/Default/HTTP Cache/Code Cache/js/5650f803178364d3_0
03-03 15:22:10.179 5359 12441 E chromium: [ERROR:simple_file_enumerator.cc(58)] Could not get file info for /data/user/0/io.homeassistant.companion.android/cache/WebView/Default/HTTP Cache/Code Cache/js/b255d76b550d0506_0

03-03 15:22:10.263 5359 12300 D WM-Processor: WorkerWrapper interrupted for 08195fb0-c4d4-4e37-8954-43c6495f491f
03-03 15:22:10.264 5359 12385 E GeocodeSM: Failed to get fused location provider client
03-03 15:22:10.264 5359 12385 E GeocodeSM: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelling}@e88d403
03-03 15:22:10.264 5359 12385 E GeocodeSM: Somehow location is null even though it was successful
03-03 15:22:10.265 5359 12300 D WM-GreedyScheduler: Cancelling work ID 08195fb0-c4d4-4e37-8954-43c6495f491f
03-03 15:22:10.267 5359 12300 D WM-SystemJobScheduler: Scheduling work ID f7c92263-ece5-41e2-a381-df98f38da136Job ID 33986
03-03 15:22:10.280 5359 12478 W chromium: [WARNING:viz_main_impl.cc(85)] VizNullHypothesis is disabled (not a warning)
03-03 15:22:10.280 5359 12385 D LocBroadcastReceiver: Registering for zone based location updates
03-03 15:22:10.281 5359 12300 D WM-GreedyScheduler: Starting tracking for f7c92263-ece5-41e2-a381-df98f38da136
03-03 15:22:10.282 5359 12300 D WM-StopWorkRunnable: StopWorkRunnable for 08195fb0-c4d4-4e37-8954-43c6495f491f; Processor.stopWork = false
03-03 15:22:10.282 5359 12300 D WM-Processor: Processor cancelling 6105837b-26df-4a3c-ae1f-0c8e17db705d
03-03 15:22:10.282 5359 12300 D WM-Processor: WorkerWrapper could not be found for 6105837b-26df-4a3c-ae1f-0c8e17db705d
03-03 15:22:10.286 5359 12385 E LocBroadcastReceiver: Issue requesting zone updates.
03-03 15:22:10.286 5359 12385 E LocBroadcastReceiver: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelling}@e88d403
03-03 15:22:10.286 5359 12385 D LocBroadcastReceiver: Zone enabled servers changed. Reconfigure zones.
03-03 15:22:10.286 5359 12385 D LocBroadcastReceiver: Removing geofence location requests.
03-03 15:22:10.286 5359 12385 D LocBroadcastReceiver: Registering for zone based location updates
03-03 15:22:10.292 5359 12300 D WM-GreedyScheduler: Cancelling work ID 6105837b-26df-4a3c-ae1f-0c8e17db705d
03-03 15:22:10.294 5359 12300 D WM-SystemJobScheduler: Scheduling work ID 916eda87-199b-464d-9be7-34532cf25ef0Job ID 33987
03-03 15:22:10.297 5359 12385 E LocBroadcastReceiver: Issue requesting zone updates.
03-03 15:22:10.297 5359 12385 E LocBroadcastReceiver: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelling}@e88d403
03-03 15:22:10.299 5359 12300 D WM-GreedyScheduler: Starting work for 916eda87-199b-464d-9be7-34532cf25ef0

03-03 15:22:10.383 5359 12310 D WM-StopWorkRunnable: StopWorkRunnable for 08195fb0-c4d4-4e37-8954-43c6495f491f; Processor.stopWork = false
03-03 15:22:10.384 5359 12385 E SensorReceiver: Exception while awaiting sensor updates.
03-03 15:22:10.384 5359 12385 E SensorReceiver: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=JobImpl{Cancelling}@e88d403
03-03 15:22:10.386 5359 5359 D WM-SystemJobService: onStartJob for WorkGenerationalId(workSpecId=f7c92263-ece5-41e2-a381-df98f38da136, generation=0)

03-03 15:22:10.540 5359 5359 W WindowOnBackDispatcher: sendCancelIfRunning: isInProgress=false callback=android.app.Activity$$ExternalSyntheticLambda0@b6d1a5b
03-03 15:22:10.541 5359 12362 E ContentCatcherManager: failed to get ContentCatcherService.
03-03 15:22:10.543 5359 5359 D View : [Warning] assignParent to null: this = DecorView@8424786[LaunchActivity]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants