[Copied from http://jlcoady.net/windows/how-to-resolve-mount-error12-cannot-allocate-memory-windows-share because it's so useful.]
If you mount a Windows 7 share using Samba/CIFS you may run into “mount error(12): Cannot allocate memory” if you are using very large files on the Windows machine. Looks like in certain situations Windows needs to be told to run as a file server and to expect large files. You can read more details at Large Files are locking up Windows 7 32 bit and 64 bit, but the solution is to make two registry edits and then restart a service:
- Set “HKLMSYSTEMCurrentControlSetControlSession ManagerMemory ManagementLargeSystemCache” to “1″.
- Set “HKLMSYSTEMCurrentControlSetServicesLanmanServerParametersSize” to “3″.
- Restart the “server” service.
Once you have done that you should be able to mount the share using a command like “sudo mount -a” or just reboot the Linux machine.