Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: argv subscript range uses too many memory



On Thu, 08 Nov 2012 16:40:01 +0800
Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> This script on my laptop uses so much memory so that being killed by
> oom-killer:
> 
> arr=(~/**/*)
> set -- "${(@)arr}"
> 
> while ((ARGC))
> do
>    print -- "${argv[1,3]}"
>    shift 3
> done
> 
> But if change the subscript range to single array elements, it works
> just fine. So I suspect there is something wrong with the subscript
> range.
> 
> Any thoughts?

I think you're right --- I think that was what was causing the memory
usage for zargs to go haywire for me last week.  I couldn't see anything
obviously wrong when I looked, but it may be a pathology with the way
memory is allocated and freed.

pws



Messages sorted by: Reverse Date, Date, Thread, Author