Instead of limiting the number of items and size, you may also be able to tie an array to a file -- this way it does not force it to load the whole array into memory and you dont have to set as much of an artifical limit on the input.
-Waswas
Comment on Re: Re: Possibly long lists and memory leaks