You have to fix something. The vector will be used if there is something larger than the ArrayList memory, and returning Enumeration instead of the list itself adds only a little more memory usage unless your caller has used a list iterator, in which case it is a line score. Of course, there is no reason for this strategy to use significantly less memory.
If you have not returned a copy of the original list? how is the new ArrayList? This would double the memory usage at least as long as the copy was made, but it would be a very long list ...
source share