badalloc + crash on big files with internal file viewer
Brought to you by:
hoffmannr
Hi,
Since the internal fileviewer is having aRead partial file
option, I 'm now and then using it if having big text files.
Recently I tried to look a file bigger than usual, a 800mb .tsv file, yet the program crashes.
Read partial file
+ scrolling downRead complete file
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
next to that there are multiple situations, I couldn't sort out ways triggering them:
thanks,
The current implementation was never really optimized for viewing large files and instead wastes a lot of memory for character lookup tables for faster preview. It can use 10 times the size of the file to view so it can crash on large files if not enough memory is available, or the system slow due to swapping. I will look into improving the memory usage.