Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
0.10.0
-
None
-
Android Studio
Description
I connect to server like this:
m_client = new DispatchBackend.AsyncClient( new TBinaryProtocol.Factory(), new TAsyncClientManager(), new TNonblockingSocket("google.com", 80) );
Then I execute request:
try { m_client.request(); } catch (TException e) { // never reaches here }
And my app crashes with OOM error.
The problem is that I can't catch exception from thrift library inside my application i.e.
inner library exception always crashes my app which is very sad.
P.S. I tried to catch Throwable instead of TException and it didn't help
Stacktrace:
E/art: Throwing OutOfMemoryError "Failed to allocate a 1213486172 byte allocation with 3514240 free bytes and 122MB until OOM" E/AndroidRuntime: FATAL EXCEPTION: TAsyncClientManager#SelectorThread 9112 Process: com.myapp, PID: 20608 java.lang.OutOfMemoryError: Failed to allocate a 1213486172 byte allocation with 3514240 free bytes and 122MB until OOM at java.nio.ByteBuffer.allocate(ByteBuffer.java:56) at org.apache.thrift.async.TAsyncMethodCall.doReadingResponseSize(TAsyncMethodCall.java:250) at org.apache.thrift.async.TAsyncMethodCall.transition(TAsyncMethodCall.java:198) at org.apache.thrift.async.TAsyncClientManager$SelectThread.transitionMethods(TAsyncClientManager.java:143) at org.apache.thrift.async.TAsyncClientManager$SelectThread.run(TAsyncClientManager.java:113)
Attachments
Issue Links
- relates to
-
THRIFT-5038 Implement MAX_MESSAGE_SIZE for java TTransport
- Resolved