script to clean shared memory