Skip to content

java.lang.OutOfMemoryError: Failed to allocate a 92862520 #1271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
escamoteur opened this issue Jul 16, 2024 · 2 comments · Fixed by #1299
Closed

java.lang.OutOfMemoryError: Failed to allocate a 92862520 #1271

escamoteur opened this issue Jul 16, 2024 · 2 comments · Fixed by #1299
Assignees
Labels
package:cronet_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@escamoteur
Copy link

Found this today in Sentry. This should produce a meaningful Client exception and not an JNI Exception-

java.lang.OutOfMemoryError: Failed to allocate a 92862520 byte allocation with 25165824 free bytes and 73MB until OOM, target footprint 216650232, growth limit 268435456
	at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
	at java.nio.DirectByteBuffer$MemoryRef.<init>(DirectByteBuffer.java:71)
	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:265)
  File "accessors.dart", line 119, in JniAccessorWrappers.throwException
  File "accessors.dart", line 11, in _check
  File "accessors.dart", line 16, in JniResultMethods.check
  File "accessors.dart", line 54, in JniResultMethods.objectPointer
  File "global_env_extensions.dart", line 674, in GlobalJniEnv.CallStaticObjectMethodA
  File "types.dart", line 89, in JObjType._staticCall
  File "jclass.dart", line 130, in JStaticMethodId.call.<fn>
  File "arena.dart", line 124, in using
  File "jclass.dart", line 130, in JStaticMethodId.call
  File "jbyte_buffer.dart", line 112, in new JByteBuffer.allocateDirect
  File "jbyte_buffer.dart", line 162, in new JByteBuffer.fromList
  File "jbyte_buffer.dart", line 293, in Uint8ListToJava.toJByteBuffer
  File "cronet_client.dart", line 429, in CronetClient.send
  File "<asynchronous suspension>"
  File "storage_service_impl.dart", line 199, in StorageServiceImplementation._uploadToS3
  File "<asynchronous suspension>"
  File "storage_service_impl.dart", line 155, in StorageServiceImplementation.uploadImage
  File "<asynchronous suspension>"
  File "upload_image.dart", line 30, in uploadImage
  File "<asynchronous suspension>"
  File "html_serializer.dart", line 194, in _Deserializer._createDocument
  File "<asynchronous suspension>"
  File "comment_draft_manager.dart", line 66, in CommentDraftManager.saveCommentDraft
@escamoteur escamoteur added package:cronet_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jul 16, 2024
@escamoteur
Copy link
Author

cc @HosseinYousefi

@brianquinlan
Copy link
Collaborator

I think that the approach would be to catch JniException and rethrow a ClientException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:cronet_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants