I wanted to use a ramdisk. SoI created one, filled it with 3GB data and unmounted it. Like this:
diskutil erasevolume HFS+ 'ramdisk' `hdiutil attach -nomount ram://8388608` cp -pr some3GBdirectory /Volumes/ramdisk umount /Volumes/ramdisk
That last statement removed /Volumes/ramdisk from the directory tree, but the 3GB stays allocated by a process called diskimages-helper. I need to kill it with SIGKILL to get the process removed and my memory back. What is the nice way to remove the ramdisk and get my memory completely freed?