I had the same problem like all of you guys.... I tried all the steps above, terminal blablah...NOTHING worked, so here is what worked for me:
Problem: I wanted to format my IDE disk to hfs+ using disc utility.
Error:
POSIX reports: The operation couldn't be completed. Cannot allocate memory.
After that I started VMWARE Fusion /Windows XP
connected my disk to xp and formated it with Partition Manager 7.0 as an fat32 disk!
Pls. Note that I had to use Partition Manager, because XP just wanted to format the drive as NTFS ...I don´t know why.......
So after I formated the disk, 1partition!
I reconnected the disk from XP and connected with OSX.... I could see my disk (fat32) on my mac...I also could read and write on it.
Still if I tried to format it again with disc utility...problem occurred again....
so I googled a lot...and I mean a lot.
My USB drive does not have an extra firewire connection....which some people state that this should solve the problem.
accidentally , but luckily I found that page:
http://db.tidbits.com/article/10618
it says somewhere "Remove the drive and put it into another enclosure, preferably one with a FireWire interface." I was sure my girlfriend had one....but after I got the enclosure from here, I realized that it has no firewire, just the normal USB!
still i thought, it might be a at least an idea just to put the drive in my girlfriends enclosure ...and give it try....and...what should I say???
IT WORKED!
I could directly format it again using disc utility.....
the drive was meant to be my Time machine backup...so i made a backup with still in the enclosure of my girlfriend...after backup stopped, I replace the disk with the original enclosure...and it still worked!
I really hope to help someone out there.
cheers danny