allocate shared mem