shared memory allocation and freein node from rbtree