OutOfMemory only on brand new Samsung models

Hi, In google console I notice traces only on Samsung phones.
my original issue for OkHttp Brand new Samsung Devices with OutOfMemory · Issue #6553 · square/okhttp · GitHub but was instantly closed.

java.lang.OutOfMemoryError:
at java.util.ArrayList.iterator (ArrayList.java:834)
at okhttp3.internal.concurrent.TaskRunner.awaitTaskToRun (TaskRunner.java:167)
at okhttp3.internal.concurrent.TaskRunner$runnable$1.run (TaskRunner.java:58)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:919)

java.lang.OutOfMemoryError:
at java.util.concurrent.SynchronousQueue$TransferStack.snode (SynchronousQueue.java:318)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer (SynchronousQueue.java:361)
at java.util.concurrent.SynchronousQueue.poll (SynchronousQueue.java:937)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1091)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:923)

Hi,
Would you please help me to reproduce the issue?
As I did not face the issue, so I would like to reproduce it first before analyzing it.

Thanks.

I can’t reproduce it, I catch this error in Crashlytics on my project, also I don’t have new Samsung device from the list of above

There are some of new exceptions only from Samsung devices:

Fatal Exception: java.lang.OutOfMemoryError
Failed to allocate a 16 byte allocation with 1283056 free bytes and 1252KB until OOM, target footprint 201326592, growth limit 201326592; failed due to fragmentation (largest possible contiguous allocation 55836672 bytes)

  1. android.os.ThreadLocalWorkSource.setUid (ThreadLocalWorkSource.java:68)
    android.os.Binder.execTransact (Binder.java:1027)

  2. java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.addConditionWaiter (AbstractQueuedSynchronizer.java:1882)
    java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2063)
    java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
    java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
    java.lang.Thread.run (Thread.java:923)

It looks as internal error of firmware, could you check the difference with original implementation with AOSP from java.util.concurrent package?

This also seem to happen when running updates within F-Droid client.

Would you please help me to reproduce the issue?
As I did not face the issue, so I would like to reproduce it first before analyzing it.

Sure:

  1. download the open source app store F-Droid
  2. install some outdated application (at least ten) versions and properly close F-Droid
  3. start F-Droid and try to update the apps

You can also see videos of the responsiveness and stack traces at this thread

Any update on this issue?
We are also seeing this issue happening only on Samsung devices in our crash monitoring report.

I see the same OOM issue in Crashlytics, mostly on Galaxy S21+ runnin g Android 11, however I can’t reporoduce it by myself. All devices have a lot of free memory, like 1.5-2GB. All stacktraces look the same:

Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 16 byte allocation with 246104 free bytes and 240KB until OOM, target footprint 536870912, growth limit 536870912; failed due to fragmentation (largest possible contiguous allocation 394526720 bytes)
at android.os.ThreadLocalWorkSource.setUid(ThreadLocalWorkSource.java:68)
at android.os.Binder.execTransact(Binder.java:1157)

I see a similar OOM issue in Crashlytics, generally on Galaxy S21+ runnin g Android 11, anyway I can’t reporoduce it without help from anyone else. All gadgets have a ton of free memory, as 1.5-2GB. All stacktraces appear to be identical:

Lethal Exception: java.lang.OutOfMemoryError: Failed to distribute a 16 byte portion with 246104 free bytes and 240KB until OOM, target impression 536870912, development limit 536870912; flopped because of discontinuity (biggest conceivable coterminous allotment 394526720 bytes)

at android.os.ThreadLocalWorkSource.setUid(ThreadLocalWorkSource.java:68)

at android.os.Binder.execTransact(Binder.java:1157)

I see a similar OOM issue in Crashlytics, generally on Galaxy S21+ runnin g Android 11, anyway I can’t reporoduce it without anyone else. All gadgets have a ton of free memory, as 1.5-2GB. All stacktraces appear to be identical:

Lethal Exception: java.lang.OutOfMemoryError: Failed to apportion a 16 byte designation with 246104 free bytes and 240KB until OOM, target impression 536870912, development limit 536870912; bombed because of discontinuity (biggest conceivable adjoining assignment 394526720 bytes)

at android.os.ThreadLocalWorkSource.setUid(ThreadLocalWorkSource.java:68)

at android.os.Binder.execTransact(Binder.java:1157)

I see a comparative OOM issue in Crash lytics, for the most part on Galaxy S21+ running Android 11, anyway I can’t reproduce it without anyone else. All contraptions have a huge load of free memory, as 1.5-2GB. All stacktraces seem, by all accounts, to be indistinguishable:

Deadly Exception: java.lang.OutOfMemoryError: Failed to distribute a 16 byte assignment with 246104 free bytes and 240KB until OOM, target impression 536870912, advancement limit 536870912; besieged as a result of brokenness (greatest possible connecting task 394526720 bytes)

at android.os.ThreadLocalWorkSource.setUid(ThreadLocalWorkSource.java:68)