admin管理员组

文章数量:1334658

I am using this approach to send file via Java HttpClient: How to define multiple parameters for a POST request using Java 11 HTTP Client

However, if the file is big ( just like 300MB ) . I will get OutOfMemoryException :

java.io.IOException: Java heap space
        at java.http/jdk.internal.http.HttpClientImpl.send(HttpClientImpl.java:593)
        at java.http/jdk.internal.http.HttpClientFacade.send(HttpClientFacade.java:123)

However can I improve the sending logic to prevent using too much memory?

本文标签: postOutOfMemoryException when using Java HttpClient to send big fileStack Overflow