fusesource / mqtt-client

A Java MQTT Client
http://mqtt-client.fusesource.org/
Apache License 2.0
1.27k stars 369 forks source link

java.lang.OutOfMemoryError: Could not allocate JNI Env #69

Closed ravendmaster closed 8 years ago

ravendmaster commented 8 years ago

Android 6.0, use with callback API in Android foreground service. The problem manifests itself sporadically, with low ( probably zero ) bandwidth 2G-3G cellular capabilities. Thank you!

java.lang.OutOfMemoryError: Could not allocate JNI Env at java.lang.Thread.nativeCreate(Native Method) at java.lang.Thread.start(Thread.java:1063) at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339) at org.fusesource.hawtdispatch.transport.TcpTransport._start(TcpTransport.java:449) at org.fusesource.hawtdispatch.transport.ServiceBase$2.run(ServiceBase.java:94) at org.fusesource.hawtdispatch.internal.SerialDispatchQueue.run(SerialDispatchQueue.java:100) at org.fusesource.hawtdispatch.internal.pool.SimpleThread.run(SimpleThread.java:77)

ycoupe commented 8 years ago

Hi @ravendmaster !

Did you find a solution for this issue ?

Thanks,

Yann

ravendmaster commented 8 years ago

Hi @ycoupe it helped - https://github.com/looluo/mqtt-client/commit/8514f22140bc19057bff96a8ad96b3577aff6400