$#a=-1 will free up all the elements of @a, allowing their memory to be reused. In addition, undef @a frees up the array's AvARRAY structure, which uses typically (4 x maximum array index ever used) bytes. Neither will free up the actual array itself; you need to ensure the variable goes out of scope for that.