android-multithreading-masterclass's People
Forkers
albodelu larsspangenberg alvindizon eimantoe takhir-nafikov sunnyshetty bontotti draketheb4dass manununhez ashishkharcheiuforks daancover mdikkii pbprateek hadysalhab faiz276482 ninalofrese victorvicari ernest75 mfperminov lobothijau lvguowei-maas jeetdholakia roshanrai06 ratnasrivastava mmoreno1992 omsamara inter-prep mosazaid yuchongming clyndonwooliesx annakandel siddhi-droid dmytro-bespalenko doomyd christianb abdallahwebdev kuralms lero12345 andresmaca scophotog adasoraninda tywangcharlie anwarseu yusufwagh gaspno tajuddinkhandaker sana-20 priyamprakash wolsz siddharth-shah saidar andresandreoli jjeewon med25ch ericntd claudiogaalvao martinsfelipemartins alfianerlian szypul86 falcon12795 geniustomato mananarya22 svilen-tech ishannadeepandroid-multithreading-masterclass's Issues
thread pool demo get Force Close
public ThreadPoolExecutor getThreadPool() {
if (mThreadPoolExecutor == null) {
mThreadPoolExecutor = new ThreadPoolExecutor(
10,
Integer.MAX_VALUE,
10,
TimeUnit.SECONDS,
new SynchronousQueue<>(),
new ThreadFactory() {
@OverRide
public Thread newThread(Runnable r) {
Log.d("ThreadFactory",
String.format("size %s, active count %s, queue remaining %s",
mThreadPoolExecutor.getPoolSize(),
mThreadPoolExecutor.getActiveCount(),
mThreadPoolExecutor.getQueue().remainingCapacity()
)
);
return new Thread(r);
}
}
);
hi, I still get force close even if with SynchronousQueue :
10-19 12:12:58.868 D 22091 24162 ThreadFactory: size 6544, active count 6543, queue remaining 0
10-19 12:12:58.869 D 22091 24129 ThreadFactory: size 6542, active count 6541, queue remaining 0
10-19 12:12:58.869 W 22091 24129 libc : pthread_create failed: couldnt mprotect R+W 1081344-byte thread mapping region: Out of memory
10-19 12:12:58.869 W 22091 24129 .multithreadin: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again" (VmSize 131067384 kB)
10-19 12:12:58.869 W 22091 24162 libc : pthread_create failed: couldnt mprotect R+W 1081344-byte thread mapping region: Out of memory
10-19 12:12:58.869 W 22091 24162 .multithreadin: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again" (VmSize 131067384 kB)
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: FATAL EXCEPTION: Thread-1529
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: Process: com.techyourchance.multithreading, PID: 22091
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: at java.lang.Thread.nativeCreate(Native Method)
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: at java.lang.Thread.start(Thread.java:884)
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:975)
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:1043)
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1185)
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-19 12:12:58.870 E 22091 24129 AndroidRuntime: at java.lang.Thread.run(Thread.java:920)
10-19 12:12:58.870 E 22091 24162 AndroidRuntime: FATAL EXCEPTION: Thread-1561
10-19 12:12:58.870 E 22091 24162 AndroidRuntime: Process: com.techyourchance.multithreading, PID: 22091
10-19 12:12:58.870 E 22091 24162 AndroidRuntime: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
10-19 12:12:58.870 E 22091 24162 AndroidRuntime: at java.lang.Thread.nativeCreate(Native Method)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.