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

OutOfMemoryError issues in the IDE #1694

Open
5 tasks done
itsaky opened this issue Feb 4, 2024 · 3 comments
Open
5 tasks done

OutOfMemoryError issues in the IDE #1694

itsaky opened this issue Feb 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@itsaky
Copy link
Member

itsaky commented Feb 4, 2024

Issue Checklist

  • I confirm that this issue is not a duplicate and hasn't been reported before.
  • I agree to follow the project's code of conduct.
  • I have checked and verified that I am using the latest version of AndroidIDE from GitHub or F-Droid.

Additional terms

  • I understand that providing incomplete or inaccurate information may result in the issue being closed.
  • I agree to provide all requested details promptly for a comprehensive bug report.

Issue explanation

This is a collection of all the OutOfMemoryError issues in the IDE that were reported earlier.

Expected behavior

There should be better memory management implementation in the IDE to avoid such issues.

Version name

The issue occurs in multiple versions of AndroidIDE.

Download source

GitHub

Relevant log output

No response

@sb-codz
Copy link

sb-codz commented Mar 21, 2024


AndroidIDE Crash Report
Version : v2.7.1-beta (27102)
CI Build : true
Branch : dev
Commit : ae1bd6f42
Variant : arm64-v8a (release)
Build type : OFFICIAL
F-Droid Build : false
F-Droid Version : null
F-Droid Version code : -1
SDK Version : 28
Supported ABIs : [arm64-v8a, armeabi-v7a, armeabi]
Manufacturer : Xiaomi
Device : Redmi6Pro

Stacktrace:
java.lang.OutOfMemoryError: Failed to allocate a 603979784 byte allocation with 25165824 free bytes and 208MB until OOM, max allowed footprint 343553896, growth limit 536870912
	at java.util.Arrays.copyOf(Arrays.java:3260)
	at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:125)
	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:660)
	at java.lang.StringBuilder.append(StringBuilder.java:203)
	at kotlin.TuplesKt.createIndent(Unknown Source:32)
	at io.github.rosemoe.sora.widget.CodeEditor.commitText(Unknown Source:188)
	at io.github.rosemoe.sora.widget.CodeEditor.onKeyDown(Unknown Source:2300)
	at android.view.KeyEvent.dispatch(KeyEvent.java:2705)
	at android.view.View.dispatchKeyEvent(View.java:12471)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1896)
	at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:432)
	at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1820)
	at android.app.Activity.dispatchKeyEvent(Activity.java:3425)
	at androidx.core.app.ComponentActivity.superDispatchKeyEvent(Unknown Source:0)
	at androidx.room.util.FileUtil.dispatchKeyEvent(Unknown Source:10)
	at androidx.core.app.ComponentActivity.dispatchKeyEvent(Unknown Source:18)
	at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(Unknown Source:22)
	at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(Unknown Source:19)
	at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:346)
	at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5188)
	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5056)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4575)
	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4628)
	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4594)
	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4734)
	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4602)
	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4791)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4575)
	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4628)
	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4594)
	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4602)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4575)
	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7303)
	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7272)
	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7233)
	at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:4345)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:201)
	at android.app.ActivityThread.main(ActivityThread.java:6806)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

    

Whenever I type /* and press enter it crash.

Behavior: Typing /* and pressing enter will not crash.

@itsaky
Copy link
Member Author

itsaky commented May 19, 2024

Relevant: #1807 (comment)

@Rafael2616
Copy link
Contributor

The log for memory issue in project setup shows this:

Stacktrace:
java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 8 free bytes and 8B until OOM, max allowed footprint 268435456, growth limit 268435456
	at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1027)
	at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1014)
	at com.itsaky.androidide.xml.internal.versions.DefaultApiVersionsRegistry.readTag(Unknown Source:183)
	at com.itsaky.androidide.xml.internal.versions.DefaultApiVersionsRegistry.readApiVersions(Unknown Source:36)
	at com.itsaky.androidide.xml.internal.versions.DefaultApiVersionsRegistry.forPlatformDir(Unknown Source:109)
	at com.itsaky.androidide.projects.api.AndroidModule.getApiVersions(Unknown Source:37)
	at com.itsaky.androidide.projects.api.AndroidModule$readResources$2$resourceFlow$1.invokeSuspend(Unknown Source:121)
	at com.itsaky.androidide.projects.api.AndroidModule$readResources$2$resourceFlow$1.invoke(Unknown Source:12)
	at kotlinx.coroutines.flow.SafeFlow.collect(Unknown Source:125)
	at com.itsaky.androidide.projects.ProjectManagerImpl$setupProject$lambda$2$$inlined$map$1.collect(Unknown Source:17)
	at kotlin.TuplesKt.toCollection(Unknown Source:61)
	at com.itsaky.androidide.projects.api.AndroidModule.readResources(Unknown Source:154)
	at com.itsaky.androidide.projects.ProjectManagerImpl$setupProject$4$jobs$1$1.invokeSuspend(Unknown Source:289)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
	at kotlinx.coroutines.DispatchedTask.run(Unknown Source:120)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(Unknown Source:95)

But some times it shows something like this: "OutOfMemoryError thrown while trying to thrown OutOfMemmoryError"

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

3 participants