If just a single instance was running, do the following

1, ipcs --note the shmid and semid from the result

2, ipcrm shm

ipcrm sem

Note: The command syntax may be different in different Unix platform.

Also, if you rae running more instnace on the same machine the procedure is little different