allocated right amount of shared memory