fix some bug of ShareMemory Main