Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1306

Gridfs chunk size should be configurable during creation

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.0
    • Affects Version/s: 2.12.2
    • Component/s: GridFS
    • Labels:
      None

      Refer:
      https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/gridfs/GridFSInputFile.java#L64

      The _chunksize and the buffer parameter gets created using the default value frm GridFS which is 255k.

      Though we can reconfigure the chunksize later using setChunkSize, however during creation 255k chunk of memory in Java program gets reserved which feels a little inefficient use of memory if we are going to resize chunksize later.

      Ideally, I think we should be able to inject the chunksize during creation:
      https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/gridfs/GridFS.java#L381
      as a parameter which can default to DEFAULT_CHUNKSIZE.

            Assignee:
            Unassigned Unassigned
            Reporter:
            sukrit007 Sukrit Khera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: