I had this problem when an automated test created a ramdisk. The commands suggested in the other answers,
fuser, were of no help. After the tests I tried to unmount it and then delete the folder. I was really confused for ages because I couldn't get rid of it -- I kept getting "Device or resource busy"!
By accident I found out how to get rid of a ramdisk. I had to unmount it the same number of times that I had run the
mount command, i.e.
sudo umount path
Due to the fact that it was created using automated testing, it got mounted many times, hence why I couldn't get rid of it by simply unmounting it once after the tests. So, after I manually unmounted it lots of times it finally became a regular folder again and I could delete it.
Hopefully this can help someone else who comes across this problem!