As your measurements indicate, the allocation of large objects is rarely a speed issue. It can be a memory fragmentation issue, but a full GC will fix that as well.
People who are stressed about allocation of result vectors such as what you are doing are mostly worried about the wrong thing. 2011/7/8 Sébastien Brisard <sebastien.bris...@m4x.org> > The thing is the first option is not frequently met in Commons-Math. > I've started to work with this option for iterative linear solvers, > but I do not like the inconsistent feel it has with the rest of CM. > Also, very crude monitoring on rather large linear systems (800,000 x > 800,000) shows that memory allocations are not even measurable... As > I said, I read that a long time ago, and someone already mentioned on > this forum that GC is getting pretty good those days... So is it > really worth worrying about memory allocation? >