Skip to content

Is the response.body().asInputStream loads whole file into memory? #2390

@huanyk

Description

@huanyk

I encountered an Out of Memory (OOM) error when using the response as a receiver while attempting to download a 6GB file. Upon investigation, I discovered that Feign doesn't seem to support downloading large files as inputstream.

final boolean shouldDisconnectResponseBody = response.body() != null
    && response.body().length() != null
    && response.body().length() <= MAX_RESPONSE_BUFFER_SIZE;
if (!shouldDisconnectResponseBody) {
  return response;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    feedback providedFeedback has been provided to the author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions