- sort memory management for arrays