@@ -25,7 +25,7 @@ public class TusUploader {
2525 private long offset ;
2626 private TusClient client ;
2727 private byte [] buffer ;
28- private int requestPayloadSize = 1024 * 1024 * 1024 ;
28+ private int requestPayloadSize = 10 * 1024 * 1024 ;
2929 private int bytesRemainingForRequest ;
3030
3131 private HttpURLConnection connection ;
@@ -116,12 +116,17 @@ public int getChunkSize() {
116116 * bigger uploads into multiple requests. For example, if you have a resource of 2MB and
117117 * the payload size set to 1MB, the upload will be transferred by two requests of 1MB each.
118118 *
119- * The default value for this setting is 1024 * 1024 * 1024 bytes (GiB ).
119+ * The default value for this setting is 10 * 1024 * 1024 bytes (10 MiB ).
120120 *
121- * Be aware that setting a low maximum payload size (in the megabytes or even less range) will result in decreased
121+ * Be aware that setting a low maximum payload size (in the low megabytes or even less range) will result in decreased
122122 * performance since more requests need to be used for an upload. Each request will come with its overhead in terms
123- * of longer upload times. Furthermore, changing this setting is rarely necessary and is only advised in a situation
124- * when a server cannot deal with streaming request bodies (e.g. some Python frameworks).
123+ * of longer upload times.
124+ *
125+ * Be aware that setting a high maximum payload size may result in a high memory usage since
126+ * tus-java-client usually allocates a buffer with the maximum payload size (this buffer is used
127+ * to allow retransmission of lost data if necessary). If the client is running on a memory-
128+ * constrained device (e.g. mobile app) and the maximum payload size is too high, it might
129+ * result in an {@link OutOfMemoryError}.
125130 *
126131 * This method must not be called when the uploader has currently an open connection to the
127132 * remote server. In general, try to set the payload size before invoking {@link #uploadChunk()}
0 commit comments