I have an ArrayList filled with 1.5 million objects of some class. When I sort this list using the Collection.sort method, the allocated JVM memory increases dramatically.
So my questions are:
This is normal? What could be the reason for this? Is this a garbage collector question that runs too slow or doesn't start often enough? Do the objects in the list have to fulfill certain specifications in order to consume less memory during sorting (in addition to not contain so much data)?
thanks!
source
share