{"action":"created","issue":{"url":"https://api.github.com/repos/loopj/android-async-http/issues/127","labels_url":"https://api.github.com/repos/loopj/android-async-http/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/loopj/android-async-http/issues/127/comments","events_url":"https://api.github.com/repos/loopj/android-async-http/issues/127/events","html_url":"https://github.com/loopj/android-async-http/issues/127","id":7877401,"number":127,"title":"Out of memory on file upload.","user":{"login":"mfahy","id":1005838,"avatar_url":"https://avatars.githubusercontent.com/u/1005838?v=3","gravatar_id":"","url":"https://api.github.com/users/mfahy","html_url":"https://github.com/mfahy","followers_url":"https://api.github.com/users/mfahy/followers","following_url":"https://api.github.com/users/mfahy/following{/other_user}","gists_url":"https://api.github.com/users/mfahy/gists{/gist_id}","starred_url":"https://api.github.com/users/mfahy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfahy/subscriptions","organizations_url":"https://api.github.com/users/mfahy/orgs","repos_url":"https://api.github.com/users/mfahy/repos","events_url":"https://api.github.com/users/mfahy/events{/privacy}","received_events_url":"https://api.github.com/users/mfahy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/loopj/android-async-http/labels/critical","name":"critical","color":"e11d21"}],"state":"closed","locked":false,"assignee":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/loopj/android-async-http/milestones/1","html_url":"https://github.com/loopj/android-async-http/milestones/1.4.4","labels_url":"https://api.github.com/repos/loopj/android-async-http/milestones/1/labels","id":450344,"number":1,"title":"1.4.4","description":"First release to be placed in Maven, and should fix most of current issues.","creator":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":163,"state":"closed","created_at":"2013-10-09T00:38:30Z","updated_at":"2014-06-22T18:32:38Z","due_on":"2013-10-21T07:00:00Z","closed_at":"2013-10-28T16:52:48Z"},"comments":4,"created_at":"2012-10-25T22:37:44Z","updated_at":"2015-03-26T00:13:27Z","closed_at":"2013-10-14T20:43:39Z","body":"Without fail, any file larger than a couple megs immediately returns an Out-of-Memory error when I attempt to post it using AsyncHTTPRequest. It appears the SimpleMultipartEntity file included builds the file in memory befre sending? Is there a way to get this to chunk & send the file in smaller bites?\r\n\r\n```\r\n FATAL EXCEPTION: main\r\n java.lang.OutOfMemoryError\r\n at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:91)\r\n at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:216)\r\n at com.loopj.android.http.SimpleMultipartEntity.addPart(SimpleMultipartEntity.java:114)\r\n at com.loopj.android.http.SimpleMultipartEntity.addPart(SimpleMultipartEntity.java:100)\r\n at com.loopj.android.http.RequestParams.getEntity(RequestParams.java:234)\r\n at com.loopj.android.http.AsyncHttpClient.paramsToEntity(AsyncHttpClient.java:584)\r\n at com.loopj.android.http.AsyncHttpClient.post(AsyncHttpClient.java:389)\r\n at com.loopj.android.http.AsyncHttpClient.post(AsyncHttpClient.java:378)\r\n at XXX.XXXXXX.XXX.doNet(ZZxxxxClient.java:143)\r\n at XXX.XXXXXX.XXX.postThread(ZZxxxxClient.java:175)\r\n at XXX.XXXXXX.X.DelegatedActivity$1.onClick(DelegatedActivity.java:114)\r\n at android.view.View.performClick(View.java:2537)\r\n at android.view.View$PerformClick.run(View.java:9157)\r\n at android.os.Handler.handleCallback(Handler.java:587)\r\n at android.os.Handler.dispatchMessage(Handler.java:92)\r\n at android.os.Looper.loop(Looper.java:130)\r\n at android.app.ActivityThread.main(ActivityThread.java:3687)\r\n at java.lang.reflect.Method.invokeNative(Native Method)\r\n at java.lang.reflect.Method.invoke(Method.java:507)\r\n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)\r\n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)\r\n at dalvik.system.NativeStart.main(Native Method)\r\n```"},"comment":{"url":"https://api.github.com/repos/loopj/android-async-http/issues/comments/86260042","html_url":"https://github.com/loopj/android-async-http/issues/127#issuecomment-86260042","issue_url":"https://api.github.com/repos/loopj/android-async-http/issues/127","id":86260042,"user":{"login":"Queatz","id":540620,"avatar_url":"https://avatars.githubusercontent.com/u/540620?v=3","gravatar_id":"","url":"https://api.github.com/users/Queatz","html_url":"https://github.com/Queatz","followers_url":"https://api.github.com/users/Queatz/followers","following_url":"https://api.github.com/users/Queatz/following{/other_user}","gists_url":"https://api.github.com/users/Queatz/gists{/gist_id}","starred_url":"https://api.github.com/users/Queatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Queatz/subscriptions","organizations_url":"https://api.github.com/users/Queatz/orgs","repos_url":"https://api.github.com/users/Queatz/repos","events_url":"https://api.github.com/users/Queatz/events{/privacy}","received_events_url":"https://api.github.com/users/Queatz/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T00:13:27Z","updated_at":"2015-03-26T00:13:27Z","body":"Still getting this on 1.4.6.\r\n\r\n```\r\n03-25 16:56:22.788  10055-10246/com.everalbum.everalbumapp W/System.err﹕ java.lang.OutOfMemoryError: Failed to allocate a 268429776 byte allocation with 16777120 free bytes and 173MB until OOM\r\n03-25 16:56:22.789  10055-10246/com.everalbum.everalbumapp W/System.err﹕ at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:91)\r\n03-25 16:56:22.789  10055-10246/com.everalbum.everalbumapp W/System.err﹕ at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:201)\r\n03-25 16:56:22.789  10055-10246/com.everalbum.everalbumapp W/System.err﹕ at com.loopj.android.http.SimpleMultipartEntity.addPart(SimpleMultipartEntity.java:139)\r\n03-25 16:56:22.789  10055-10246/com.everalbum.everalbumapp W/System.err﹕ at com.loopj.android.http.RequestParams.createMultipartEntity(RequestParams.java:515)\r\n03-25 16:56:22.789  10055-10246/com.everalbum.everalbumapp W/System.err﹕ at com.loopj.android.http.RequestParams.getEntity(RequestParams.java:447)\r\n03-25 16:56:22.789  10055-10246/com.everalbum.everalbumapp W/System.err﹕ at com.loopj.android.http.AsyncHttpClient.paramsToEntity(AsyncHttpClient.java:1310)\r\n03-25 16:56:22.789  10055-10246/com.everalbum.everalbumapp W/System.err﹕ at com.loopj.android.http.AsyncHttpClient.post(AsyncHttpClient.java:925)\r\n03-25 16:56:22.789  10055-10246/com.everalbum.everalbumapp W/System.err﹕ at com.loopj.android.http.AsyncHttpClient.post(AsyncHttpClient.java:912)\r\n```"}}