Hi I need to create few large CSV Files the order of entires could be 2 million. i so i was wondering how to do it efficiently.. and hence few questions crop up my mind

1 . when we Write File via a BufferedWriter how often should we flush? however i think that bufferedWriter maintains its own buffer and it flushes it automatically once the buffer is full if that is the case then why is flush method there at all ??

  1. As the file i am going to create would be big . so when i start writing the file will the file be automatically be committed to disk?? (before calling writer.close()) or the whole file remains in the main memory till i close the writer?.

    • by commiting i mean that no part of the already written portion is in main memory i.e it is ready for GC
Edit
Report