vector swap to free memory not clear