#248 Correct "file too large" error (bug 3049370)

Don HO

The old method of catching access violations when loading, to detect that file is too large, does not work with latest Scintilla. This patch uses SCI_GETSTATUS to verify that Scintilla was able to add the text to its buffers. It also allocates memory before starting to load file to detect insufficient memory early, reduce memory fragmentation, and speedup loading.
It has been tested to load correctly 512MiB file on my system, while 5.7.1RC was truncating a 200MiB file without warning. It has also been tested to display immediately (before reading whole file) an error when trying to load a 1GiB file.


  • François-R Boyer

    Patch to correctly load larger files

  • Don HO

    Don HO - 2010-09-06

    Nice patch.
    It seems the file loading performance is improved.
    Could you confirm that?


  • Don HO

    Don HO - 2010-09-06
    • assigned_to: nobody --> donho
    • priority: 5 --> 9
  • François-R Boyer

    Yes, I confirm that this patch improve loading performance by allocating enough memory first (it may not evaluate memory requirements precisely for DBCS encodings, but it should still be better than it was before). The previous method for loading file was to directly add text to Scintilla buffer without first specifying how much text will be added, and Scintilla allocates and copy the whole buffer each time it is too small for added text, which will occur several times if there is no initial size set (this wastes time, and requires twice the memory while loading file).

  • Don HO

    Don HO - 2010-09-07

    Thank you François.
    It's in revision 659.


  • Don HO

    Don HO - 2010-09-25
    • status: open --> closed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks