The issues seems to cause by Windows rather than Ubuntu itself. There is a good explanation in this link:
But I will copy & paste some of the content here, in case the link broken in the future.
======== Copy & Paste from archlinux.org, please contact me if remove is required ========
Windows 7 connectivity problems - mount error(12): cannot allocate memoryA known Windows 7 bug that causes "mount error(12): cannot allocate memory" on an otherwise perfect cifs share on the Linux end can be fixed by setting a few registry keys on the Windows box as follows:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache(set to
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d 1 /f reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "Size" /t REG_DWORD /d 3 /fDo one of the following for the settings to take effect:
- Restart Windows
- Restart the Server service via services.msc
- From the Command Prompt run: 'net stop lanmanserver' and 'net start lanmanserver' - The server may automatically restart after stopping it.