Menu

#47 badalloc + crash on big files with internal file viewer

next
closed
nobody
None
9
2025-01-11
2023-06-07
rno
No

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.

ways triggering the crash

  • using internal file viewer on a big file - tested with a 800Mb file
  • Read partial file + scrolling down
    *or *
  • Read complete file

the crash

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:

  • sometime worker freezes, and the mouse pointer cannot be used on the entire X11
    The operating system is otherwise functional, yet with keyboard only. I can recover the mouse pointer only if I quit worker.
  • sometime worker quits abruptly/seems crashing
    yet it's still in list of running commands
  • sometime worker quits abruptly/seems crashing
    and it's not any longer in list of running commands

things I tried / background

  • tested with version version 3.15
  • tested with version version 4.11
  • I checked the file it is a valid tsv.
  • it's also happening next rebooting
  • it's also happening despite most of 8gb memory available - with other programs closed
  • it's also happening with other kernels. though I tried only with three, the recent debian stable kernels v5.10.xxx

thanks,

Discussion

  • Ralf Hoffmann

    Ralf Hoffmann - 2023-06-07

    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.

     
  • Ralf Hoffmann

    Ralf Hoffmann - 2025-01-11

    this is improved in 5.0.0

     
  • Ralf Hoffmann

    Ralf Hoffmann - 2025-01-11
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB