Thiago Padilha wrote:
> > It's easy to accidentally make a Vim script that consumes all memory.
>
> If you see this often then you must be running Vim on a machine with
> an extremely low amount of memory. This is not the case for most users
> though, in the few years using Vim I never experienced this and I use
> some pretty heavy plugins. Even if OOM was common due to bugs in
> vimscript, it's not like the user will try to recover the current Vim
> instance without exiting. The common course of action would be to exit
> and remove the buggy vimscript program. Add this to the fact that not
> handling OOM simplifies code and you will see that it's not so weird
> that Neovim opted for this path.
When I just had my Amiga I installed some tools, such as a csh
implementation, that didn't check for running out of memory. The author
said it wasn't needed, because the Amiga has 1 Mbyte of memory so you
would never run out! Obviously these tools crashed once in a while, and
then you didn't know if it was because of lack of memory or anything
else...
Also, computers are so fast these days that they can execute an infinite
loop in 6 minutes!
I think you get my point.
> > Though I would better see NeoVim developers to add OOM testing rather
> then make the app crash, but this would add too much overhead for
> little gain because OOM is rare.
>
> Testing OOM should be easier now that Neovim abstracts all memory
> management functions into memory.c(for jemalloc integration). With
> some changes we could add a hook that simulates out of memory. But as
> you said, OOM is rare enough for this to have an extremely low
> priority.
Tests are good. Crashing is not good, no matter what the reason.
An editor should never crash, even when the user does something stupid.
Or a plugin author forgets some corner case.
--
There are two ways of constructing a software design. One way is to make
it so simple that there are obviously no deficiencies. The other way
is to make it so complicated that there are no obvious deficiencies.
-C.A.R. Hoare
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.