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 · 2 comments
Open

java.lang.OutOfMemoryError in android #5059

AutumnSun1996 opened this issue Feb 25, 2025 · 2 comments
Labels
bug Something isn't working

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.

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

No branches or pull requests

2 participants