Please read up some more about Java and GCs. Memory allocation and GC are heavily intertwined.