Your test, Andrew, does not show that fish imposes limits. Quite the
opposite. What you did was similar to the user who ran

read x </dev/null

and was surprised when fish consumed all available memory because the read
never saw a newline character. That is why we recently introduced a 10 MiB
limit on how much data `read` will consume. We do not impose any analogous
limits on how many items a variable can have or the total memory consumed
by the variable. Your test exploited the lack of such limits to create a
OOM condition (out of memory). Whether or not we should impose more limits
is debatable. If anyone feels that we should please open an issue at
https://github.com/fish-shell/fish-shell/issues/new


On Tue, Feb 14, 2017 at 8:51 PM, Andrew Toskin <summerfallsa...@gmail.com>
wrote:

> On Tuesday, February 14, 2017, Kurtis Rader <kra...@skepticism.us>
> wrote:
> > The fish shell has no hard code limits on such things. You're
> essentially limited by available memory (or virtual address space).
>
>
> That's what I would have guessed.
>
> But I was suddenly curious, so I thought I'd try. I created a variable,
> foo, that contained an array of identical items -- the letter "a".
>
>   set  foo  a  a  a  a...
>
> That's an awfully slow way to grow a list, but it got me started. I
> then added foo to itself several times.
>
>   set  foo  $foo  $foo  $foo...
>
> And I ran `count` on the growing array between each repitition. I think
> by the second or third time, $foo contained several thousand items --
> but it was still nice and snappy. Then it had about 1.4 million items,
> and count took a couple seconds before it printed the number. Then my
> computer froze just about ground to a halt -- `count` took about 10
> minutes before it reported something like 55 million items. Even after
> killing all running fish processes on my system, everything was a
> little sluggish until I rebooted.
>
> I have kind of an old desktop at home, though. Your mileage may vary.
>
>
> > If you're doing something where such limits are a concern you
> should be using a different language such as C++, Java or Python.
>
>
> Yup, haha, if you need to do some serious programming work, pick a
> serious programming language.
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to