Gridfs chunk size should be configurable during creation

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Major - P3
    • 3.1.0
    • Affects Version/s: 2.12.2
    • Component/s: GridFS
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            Sukrit Khera
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: