Currently the photo upload methods cannot take advantage HTTP chunked streaming mode. This mode is very useful if the client software is running on a memory constrained device, and the user is uploading a large photo. Without using chunked streaming mode, the HTTP request body will be buffered on the heap, and that buffer memory can grow exponentially and exceed the VM maximum heap size.
This patch adds an API to optionally set the streaming mode chunk size in HTTP POST, via the setChunkSize() method as part of the Upload MetaData.
unified diff patch file