How to Resolve “mount error(12): Cannot allocate memory” on a Windows Share

October 18th, 2010 | Tags: , , , ,

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:

  1. Set “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache” to “1”.
  2. Set “HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size” to “3”.
  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.

  1. JohnO
    June 28th, 2012 at 05:56
    Reply | Quote | #1

    Worked for me! However, the first variable (#1) above was not present in my registry, however the 2nd one was, modified it and could mount the cifs share.

  2. June 29th, 2012 at 03:03
    Reply | Quote | #2

    Works like a charm, thank you! (Ubuntu 12.04 Client accessing Windows 7 Professional)

    German translation:

  3. Andrea
    July 11th, 2012 at 00:34
    Reply | Quote | #3

    GRAZZZZZIIIIIEEEE!!!! Funziona! It Works! Many Many Many thanks!

  4. peffe
    August 1st, 2012 at 23:14
    Reply | Quote | #4

    Awesome. I am able to mount my windows share again :) thanks a lot.

  5. Leftie
    August 6th, 2012 at 10:43
    Reply | Quote | #5

    Clear and concise info, got things working and even got an explanation as to why the problem occurred. Thanks a lot!

  6. Figaro
    August 21st, 2012 at 08:03
    Reply | Quote | #6

    Many thanks. I was going nuts trying to get SMB4K working against W7. Saved my day(s).

  7. and
    September 6th, 2012 at 04:00
    Reply | Quote | #7


  8. Storch
    September 10th, 2012 at 06:25
    Reply | Quote | #8

    Worked like a charm! You the man!

  9. 1 trackbacks
Comment pages