in reply to memory consumption skyhigh...

Use a database if you'd like to work with large datasets. True for any language.