Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash On Windows "cannot allocate memory" for dotnet build command #1563

Closed
manikandan05 opened this issue Jan 2, 2017 · 12 comments
Closed

Comments

@manikandan05
Copy link

Hi,

I have configured the Bash on windows in my machine and installed the necessary packages as mentioned by Microsoft.

Now, I have created one dotnet project and execute the dotnet restore command also executed successfully. But, when I'm trying to execute the **dotnet build** command will always show the "cannot allocate memory" issue.

bash

Thanks for any help.

@aseering
Copy link
Contributor

aseering commented Jan 2, 2017

Hi @manikandan05 -- thanks for reporting this! Could you please provide more of the information in the ticket template? In particular, your Windows version ("OS Build") would be useful, as would an strace of the specific affected command.

@manikandan05
Copy link
Author

Hi @aseering ,

I have used Windows 10 machine with Bash option enabled, i have completed all the necessary configurations based on this below link

https://blogs.msdn.microsoft.com/commandline/2016/04/06/bash-on-ubuntu-on-windows-download-now-3/

My system details are

windows

ubuntu

My Ubuntu version as 14.04 so I have followed the dotnet installation based on Microsoft described way

microsoft

But, i don't know why I'm stuck in this issue?

Thanks for any help!

@aseering
Copy link
Contributor

aseering commented Jan 3, 2017

Hi @manikandan05 -- thanks for providing more information, but I'm afraid that simply providing random extra factoids is not going to help here. I'm specifically looking for your Windows version ("OS Build") and an 'strace' of the specific affected command, or other answers to the specific questions in the issue template.

Do you not know how to gather some of that information? If not, and if you can't figure it out on your own, please feel free to ask; it'll work much faster than guessing :-) For example, you can find the OS Build by typing "About your PC" into Cortana -- this will open up a Settings panel; "OS Build" will be about halfway down the page.

Incidentally, the short answer to why you're stuck at this issue is that WSL is beta software and does not yet fully and exactly emulate all edge cases of a Linux environment. And dotnet has a very sophisticated runtime that depends on some rather specific behavior of the Linux kernel. This particular error sounds to me like a compatibility issue that was theoretically fixed (or at least much-improved) in recent Windows pre-release Insider builds, which is why I asked for your exact "OS Build". If you're running stable Windows, I would advise you to try this out on an Insider build if possible. If you're already running a recent-enough Insider build, then things get more interesting, and the strace would indicate exactly what syscall is failing.

@manikandan05
Copy link
Author

Hi @aseering ,

I have not installed Insider builds in my machine. Now, i will install and check this case. Apart from this, now i have shared my machine OS build version.

build

@manikandan05
Copy link
Author

Hi @aseering,

I have tried all possibilities after "Insider build" option enabled in my system. But, unfortunately the same issue persists when run my ASP.NET Core application.

insider

Thanks for any help!

@aseering
Copy link
Contributor

aseering commented Jan 3, 2017

Thanks @manikandan05 for sharing your OS Build!

It says that you are on build 14393. (The numbers after the decimal are less important in this case, as it turns out.) This indicates that you are using the stable version of Windows, not a more-recent Insider build.

The screen shot that you have shared indicates that you are currently requesting the "Release Preview" Insider build. Updated versions of WSL have only been released to the "Slow Ring" and the "Fast Ring". So you will have to choose one of those options in the dropdown menu.

Note that this window says that "It will take some time to receive a build after changing your settings." What this means is that, after you change the setting in this dropdown box, you may have to wait as long as 24 or 48 hours (sometimes longer, though that's unusual in my experience). Then, new builds will start showing up as regular Windows Updates.

If you want to try out a new Slow Ring build more quickly, there are two options:

Note that these options will give you a more-recent build, but they may not give you the very latest build. If you want the latest build, you have to choose the "Fast Ring" option in the window above and wait a day or two.

If you're new to Insider builds, please be aware that they can cause system crashes and other problems: The version of WSL that they include is much-improved, but they bundle other new features that may introduce new bugs as well. If you're not comfortable with that risk, the safest approach is to download the VM.

@therealkenc
Copy link
Collaborator

therealkenc commented Jan 4, 2017

The dotnet hello world example does seem to compile and run on 14986 for what it's worth. Fifty cents says the "cannot allocate memory" problem originally reported is #851 though, which hasn't actually flushed to fast ring yet.

@spagu
Copy link

spagu commented Feb 6, 2017

I did LXR reinstall - and problem is still there. Maybe windows is not allowing console to use memory.

@benhillis
Copy link
Member

@spagu - What windows build are you on?

@afwn90cj93201nixr2e1re
Copy link

afwn90cj93201nixr2e1re commented Feb 8, 2017

@benhillis #1403 (comment), some error there.

@manikandan05
Copy link
Author

manikandan05 commented Feb 16, 2017

Now, i have tried with latest OS build : 15014.1000 Preview from the below mentioned link. The ASP.NET Core sample will be working fine while creating and deploying from Bash on Windows. The sample also launched in browser without any issues (like previously mentioned cannot allocate memory not reprodued).

https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

@therealkenc
Copy link
Collaborator

Calling this a dupe for want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants