in reply to Sorting files

You should also make sure you're not making unnecessary copies of the array(s), such as when calling functions. Duplication will drastically reduce the amount of data you can hold before you run out of memory;)