Skip to content

Conversation

@kasobol-msft
Copy link
Contributor

@kasobol-msft kasobol-msft commented Jul 21, 2021

@ghost ghost added the Storage Storage Service (Queues, Blobs, Files) label Jul 21, 2021
@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft
Copy link
Contributor Author

/azp run java - storage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kasobol-msft kasobol-msft marked this pull request as ready for review July 22, 2021 15:05
*/
public static final int BUFFER_COPY_LENGTH = 8 * KB;

public static final int MAX_INPUT_STREAM_CONVERTER_BUFFER_LENGTH = 64 * MB;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did we come to this value? Should we add some documentation explaining why we need to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We know that allocating Int.MAX leads to java.lang.OutOfMemoryError: Requested array size exceeds VM limit (there are plenty of articles about it).
  2. Allocating big arrays isn't great - they put more pressure on GC if heap is fragmented and it's lesser chance of allocating one.
  3. The value is guestimated based on few experiments. I.e. for jumbo blobs going to low means too much extra garbage to just wrap arrays into buffers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants