setting memory allocations in spring bean