Improve memory allocations (to avoid huge gc when allocating thousands of objects).