question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hundreds of RxCachedThreadS

See original GitHub issue

Hi thank you very much for this amazing project. Our product is using this framework and we have delivered into the market with great success.

However we have observed considerable amount of Exception among our users.

OutOfMemoryError: pthread_create (1040KB stack) failed: Try again

On some of our test devices, we found that we get 200+ RxCachedThreadS. listed as following

android_device:/ $ ps -t 26731 |grep RxCachedThread| wc -l                                                                                                                                                  
201

My opinion is those cached threads is way too much. I found a relevant article here. I’ve made sure every Observable.create calls the onComplete method. But the issue persists.

Can you please provide some suggestions which orientation shall we look into?

We are using RxJava:2.1.8 and RxAndroid:2.0.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
changxiangzhongcommented, Oct 26, 2019
"RxCachedThreadScheduler-8" daemon prio=5 tid=64 Waiting
  | group="main" sCount=1 dsCount=0 obj=0x159c59d0 self=0x89e61100
  | sysTid=7765 nice=0 cgrp=default sched=0/0 handle=0x7dcfa920
  | state=S schedstat=( 0 0 0 ) utm=1 stm=0 core=1 HZ=100
  | stack=0x7dbf8000-0x7dbfa000 stackSize=1038KB
  | held mutexes=
  at java.lang.Object.wait!(Native method)
  - waiting on <0x0cb0e8e6> (a java.lang.Object)
  at java.lang.Thread.parkFor$(Thread.java:2127)
  - locked <0x0cb0e8e6> (a java.lang.Object)
  at sun.misc.Unsafe.park(Unsafe.java:325)
  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
  at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1091)
  at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1084)
  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
  at java.lang.Thread.run(Thread.java:761)

It seems like a thread is wait() for another thread to notify() forever.

Is there options to print all the observeOn and subscrieOn threads?

0reactions
daixjcommented, Feb 17, 2022

Thank you @akarnokd. It’s really helpful

how to solve this question?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schedulers.io creates hundreds of RxCachedThreadSchedulers
I use RxJava in my android app and it ran into OutOfMemoryError several times. I checked it with Device Manager and I just...
Read more >
IDE Close - Save changes dialogue ignores Y and N - Processing ...
When you close the IDE it may prompt you to save changes - with Yes and No buttons. The Y and N are...
Read more >
Bloglovin'
The easiest way to follow your favorite blogs.
Read more >
xbps-src update-bulk on foreign distro - Void-Linux/Void-Packages
Hundreds of RxCachedThreadS, 1, 2019-10-25, 2022-07-13. [Turing Data Story] Building a simple web scraper, 0, 2021-03-26, 2022-08-14.
Read more >
Hundreds of RxCachedThreadS - ReactiveX/RxAndroid
On some of our test devices, we found that we get 200+ RxCachedThreadS. listed as following. android_device:/ $ ps -t 26731 |grep RxCachedThread|...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found