Sometimes, this code prints a negative number, like -64. The value is in KB.
What could be happenning?
long memoriaInicial = Runtime.getRuntime().freeM
It means after you've sorted, the garbage collector has probably freed more memory and you have more than you started out with.