Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the entire upload out of heap: use bounded buffers from the HTTP request through storage, and check every layer that might stage or copy the file. In Java, a streaming-looking API does not guarantee constant-memory behavior. AWS SDK for Java 2.x, for example, warns that a synchronous upload from an unknown-length InputStream may buffer the whole stream to determine its length.

Why a “streaming” upload can still consume too much memory

An upload has at least two separate paths to inspect: the inbound HTTP request and the outbound write to storage. A multipart request abstraction such as a framework file object does not prove that the file stayed out of memory—or that a later storage SDK will avoid buffering it.

Trace the bytes through the whole path. On ingress, check whether the servlet container holds request parts in memory, spills them to a temporary directory, or uses a configured threshold. On egress, look for conversions to byte[], copied in-memory buffers, unknown-length synchronous stream uploads, and SDK-level buffering. Repeated copies and concurrent part transfers can multiply memory use even when your own copy loop uses a small buffer.

  • Heap: application buffers, SDK buffers, and any in-memory request staging.
  • Temporary disk: container staging and any file-backed upload path.
  • Concurrency: simultaneous requests and in-flight multipart parts.

Plan for these budgets separately. A bounded buffer in one layer does not establish a bounded total-memory footprint for the request.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Check inbound multipart handling before changing the storage client

Find the multipart settings for the exact Spring Boot and servlet-container versions your application runs. Determine the request-part size threshold for flushing to disk, the temporary directory, and how temporary files are cleaned up. Confirm that the directory has enough capacity for concurrent uploads and that it is not on a small or unexpectedly slow filesystem.

The Spring Boot 2.1.2 reference documents an overridable intermediate-data location and disk-flush threshold, and recommends container multipart support. That is an older reference, not evidence of defaults in current Spring Boot releases. Check the documentation for the versions actually deployed rather than copying old property defaults.

For AWS SDK for Java 2.x, supply a correct stream length when you know it

AWS warns that a synchronous S3 upload from an InputStream with unknown length may buffer the entire stream to calculate content length. Its documentation puts the risk plainly: “Because the SDK buffers the entire stream in memory to calculate the content length, you can run into memory issues with large streams.” See AWS SDK for Java 2.x stream-upload guidance.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

If the source can provide an exact length, pass that known, correct value to the request body. Do not estimate it: AWS warns that a value that is too small can truncate the object, while one that is too large can cause a failed upload or a connection that hangs. If the stream is large and its length is unknown, do not assume a single synchronous putObject call will remain constant-memory; use a deliberate multipart design instead.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose an upload path by balancing memory, disk, and retries

Path What it helps with What to budget or verify
Container multipart staging Can spill request parts to temporary disk instead of retaining all request data in heap. Framework and container behavior, threshold, temporary-disk capacity, concurrency, and cleanup. Current defaults are version-specific; the cited Spring reference is for 2.1.2.
Known-length synchronous stream Provides a simpler single-request path when the stream length is available and accurate. Length accuracy and SDK behavior. AWS SDK for Java 2.x warns that an unknown-length synchronous stream may be buffered in full.
Multipart upload Parts can be retried independently and uploaded in parallel, which may help recovery or throughput for large objects. Additional API calls, chosen part size, in-flight parts, and their memory or disk use. There is no universal Java size threshold.
File-backed CRT transfer AWS documents direct disk streaming for large file uploads with its CRT-based path, avoiding intermediate part buffering for those disk uploads. Temporary-disk capacity and the precise SDK/client configuration. For memory-originated streams, CRT may buffer each part.
Sequential streaming multipart provider Can write large data incrementally using a stated bounded part-buffer model. Provider and CRT dependency, sequential-write assumptions, exact release/configuration, and fallback behavior for backward seeks.

Use multipart deliberately for large S3 objects

Amazon S3 documents a maximum of 5 GB for a single PUT and multipart upload for larger objects, up to the currently documented 50 TB limit. These are S3 service limits, not Java limits. See S3 upload options and S3 multipart upload.

Multipart parts can be uploaded independently, in any order, and in parallel. That can make retrying a failed part easier and can improve transfer performance in suitable conditions, but it adds API calls and makes concurrency part of the resource budget. AWS’s Java multipart configuration guidance advises a single connection for small objects rather than applying multipart indiscriminately.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Choose a threshold based on your expected file sizes, retry requirements, network latency and throughput, and the memory and disk available per application instance. Then account for how many requests can run at once. A useful planning model is to estimate memory for each active request’s application and SDK buffers plus its in-flight part buffers, then multiply by the maximum concurrent upload count. Treat that as a capacity estimate, not a universal formula: actual buffering depends on the client, source type, configuration, and deployed SDK version.

Set and validate part-size controls

The AWS Java multipart configuration API exposes a multipart threshold, minimum part size, and API-call buffer size. The reference gives 8 MiB as the default for minimumPartSizeInBytes; verify that default and the settings’ exact semantics against the SDK version in your application. AWS also notes that effective part payload may need to grow to stay within the maximum number of parts. See the Java multipart configuration API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Larger parts can mean fewer requests but more data associated with each in-flight transfer; more concurrent parts can raise memory demand. Test the chosen settings with realistic file sizes and concurrent request counts, and observe heap, temporary-disk usage, and failed or retried parts under load. The available documentation does not establish a universal Java heap requirement or a guaranteed speedup.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Consider CRT transfers when the source is a file

AWS documents that its CRT-based S3 path automatically switches large file uploads to direct streaming from disk rather than buffering intermediate parts; the documented Java SDK option can enable this behavior for smaller files as well. For data that originates in memory, CRT may buffer each part, so available memory can constrain throughput. AWS identifies the Java Transfer Manager on the CRT-based client as a way to perform multipart uploads above a threshold. See AWS’s large-file SDK guide and S3 upload options.

Disk-backed transfer reduces intermediate memory buffering; it does not make storage free. Include the staged file and active uploads in temporary-disk capacity planning, and ensure the application has a cleanup strategy for completed, failed, and interrupted requests.

For sequential writes, evaluate the AWS Labs NIO.2 S3 provider carefully

The AWS Labs Java NIO.2 S3 provider documents a sequential streaming multipart mode that requires the AWS CRT client. Its project documentation states defaults of 8 MiB parts and four in-flight uploads, with approximate memory use of (maxInFlight + 1) × partSize—about 40 MiB under those stated defaults. These are provider-specific documented settings and an approximate formula, not a general Java or AWS SDK guarantee; confirm the release and configuration you use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

The mode is described for sequential large writes. Random backward seeks can trigger fallback behavior; if fallback is enabled, the provider retains all written data in memory to support reconstruction. A workload that may seek backward should not rely on the sequential mode’s bounded-part memory estimate without accounting for that fallback.

Validate the whole path under realistic concurrency

  1. Map the request path: record the framework and servlet-container versions, multipart staging threshold, temporary directory, and cleanup behavior.
  2. Map the storage path: identify every conversion or copy, the storage client and SDK version, stream-length handling, multipart settings, and whether transfers are file-backed or memory-backed.
  3. Set explicit budgets: choose limits for concurrent requests and in-flight parts, then reserve both heap and temporary disk for the maximum expected load.
  4. Exercise edge cases: test known and unknown stream lengths, large files, interrupted transfers, retries, and any seek behavior the source can perform.
  5. Observe resource use: monitor heap and temporary-disk consumption as concurrent uploads rise; verify that completed and failed uploads release buffers and staged files.

For S3, use the documented single-PUT or multipart approach appropriate to the object and transfer path. Keep service limits, SDK defaults, and provider-specific memory claims separate from general Java guidance.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.