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. Alexbr
    July 19th, 2011 at 11:11
    Reply | Quote | #1

    It works! Thanks!

  2. Antonio
    August 4th, 2011 at 09:53
    Reply | Quote | #2

    Really really helpful. Thanks.

  3. Peter Darley
    September 27th, 2011 at 10:58
    Reply | Quote | #3

    Thanks for posting this. It was a huge help to me. :)

  4. October 19th, 2011 at 10:31
    Reply | Quote | #4

    Worked perfectly — thanks so much!

  5. November 7th, 2011 at 16:39
    Reply | Quote | #5

    Worked like a charm. I had this info years ago written down but lost it. Ran into this issue recently rsyncing from Ubuntu 11.10 to Windows 7 share. Was able to mount the share first but after a few gigs of transfer the memory error occurred.

    Did the above and everything good to go. 532gigs of data.

    Thanks for the clear and working info.

  6. David Wright
    November 24th, 2011 at 10:27
    Reply | Quote | #6

    This information was super helpful in overcoming frequent share crashes on an Ubuntu Virtual machine on my Windows 7 system. Up until I found this info, I could only keep restarting my Ubuntu machine. Thanks so much!

  7. Brian
    January 14th, 2012 at 05:09
    Reply | Quote | #7

    Brilliant – worked perfectly!

  8. CJ
    January 30th, 2012 at 05:14
    Reply | Quote | #8

    Thanks this solved an issue with clonzilla using Samba/CIFS to mount and clone images.

  9. Tony Pott
    February 6th, 2012 at 06:03
    Reply | Quote | #9

    Thank you!
    A clear answer that works.

  10. Stianova
    April 5th, 2012 at 02:37

    Thank you very much for this! Finally I can access winshare (win7) using Mint 12.

  11. Brainstream
    April 7th, 2012 at 07:11

    Thank you so much! It works.

  12. April 26th, 2012 at 21:27

    Thank you! That fixed a problem I had on Windows XP. With XP, of course, instead of a useful error message, it was giving me a “beep” and nothing else at all.

    – Bogdan

  13. yuandong
    May 8th, 2012 at 18:27

    Thank you so much . Today when i make linux from scrtch ,and want eo back up some file ,it occurs.thank you

  14. Alex Walters
    May 10th, 2012 at 04:52

    Cheers, worked a treat :)

    For the benefit of other people coming this way via search engines – I was seeing both the following messages on screen:

    mount error(12): Cannot allocate memory
    mount error(112): Host is down

    And these messages in the dmesg log:

    [ 8133.342845] CIFS VFS: Send error in SessSetup = -12
    [ 8133.342876] CIFS VFS: cifs_mount failed w/return code = -12
    [ 8148.360061] CIFS VFS: No response for cmd 114 mid 1
    [ 8148.360092] CIFS VFS: cifs_mount failed w/return code = -112

    All of which have ceased and my shares are working once again. Very odd since this was all working for me last week!

  15. Anil
    May 24th, 2012 at 18:32

    Thanks a ton. It worked.

  16. Alexander
    May 27th, 2012 at 21:40

    Thanks a lot!

  17. JesusM
    May 28th, 2012 at 03:37

    Thanks! It worked perfectly

  18. Yau
    June 7th, 2012 at 01:28

    Thank you very very much. This works!! :)

  19. MAXakaWIZARD
    June 7th, 2012 at 08:33

    Thank you! Saved me a day.

  20. June 15th, 2012 at 21:11

    Works perfectly. Thanks so much.

Comment pages