New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StringTreeBuilder would be improved if it didn't need to hold an entire copy of the file in memory #106
Comments
The parser can read a line at a time now and add it to the StringTree being built in StringTreeBuilder, and does not require an ArrayList<String> holding the entire contents of the file in memory (even temporarily).
And now GedcomFileReader no longer offers an option to read the whole file into an ArrayList of strings - if you want that, build your own ArrayList.
v2.3.1-SNAPSHOT at 2016-07-03T12:12:33-04:00 includes this code. |
Thank you, I tried your latest version 6d73abd and it works very well. |
Harald - thanks so much for the confirmation and the excellent graphs! |
Found a little flaw in the parser rate handling. A patch is attached. (patch removed) |
Same patch with fixed test cases. |
Thanks to Harald Undander for the patch
Thanks to Harald Undander for the patch
Released in v2.3.1 |
The parser can read a line at a time now and add it to the StringTree being built in StringTreeBuilder, and does not require an ArrayList<String> holding the entire contents of the file in memory (even temporarily).
…ings And now GedcomFileReader no longer offers an option to read the whole file into an ArrayList of strings - if you want that, build your own ArrayList.
The makeStringTreeFromFlatLines() method of StringTreeBuilder take as a parameter a List containing all the lines of the file being read. This consumes a lot of memory unnecessarily (at least temporarily) while the file is parsed. If GedcomFileParser could support returning a BufferedReader object (in addition to getting the full list of file lines as Strings) that would return a line of the file at a time, StringTreeBuilder could be modified to use that reader and only a line at a time would need to be in temporary memory instead of the entire file's contents....which would make a huge difference in heap consumption, obviously.
The text was updated successfully, but these errors were encountered: