-
Notifications
You must be signed in to change notification settings - Fork 27.4k
grunt "minall" step fails with Error: Could not create virtual machine. (Solution found, unsure about PR) #4595
Comments
+1 |
+1 |
The current grunt scripts require at least 2GB of heap space to be allocated by the JVM, even though this is not needed to actually complete the build. Adding 64-bit to the mix, this means grunt package fails on machines without a whole 4GB of RAM free. Closes angular#4595
This bug was run into on one of my separate repositories which uses the closure compiler as well, and we were able to solve it by the mechanism suggested here:
I thought there was already a patch implementing this, but maybe I'm mistaken edit I guess #4831 wasn't merged yet... hmm I guess they aren't sure about merging it because they aren't positive 512mb would be enough for the closure compiler to work on the library. It's hard to say --- but since people with 32bit JVMs seem to be able to build Angular with that setting, and not with the higher setting, it's probably okay, is it not? |
Well, something needs to be done, I inadvertently committed that change to |
Fix: Install 64-bit JVM
Don't worry about installing 32-bit and 64-bit Java side-by-side They work together just fine. In fact, you can even have multiple version of Java (6 and 7 for example) installed side-by-side. No worries. |
Ben Lesh |
Tried that solution, after switching to 64-bit Java (
I have Win7 x64, 8GB RAM. As I understand, the only workaround is to apply this change: MJRichardson@51e3290 ? |
@Blesh yes, it also solved my problem on mac by installing java 64bit for mac. |
All steps outlined for building the Angular project would work right up until I ran
grunt package
. At that point it would run until it made it to the"minall"
task and it would fail.Problem discovered
Upon further investigation I went into
lib/utils.js
and had grunt.log print out the shell command it was executing to run closure.jar against each file.The command that was being run was:
At that point I was given the message(s):
Apparently my 32-bit JVM on Windows 7 does not like allocating 2gb of space. I'm not sure why, because AFAIK, 2gb is the maximum heap size value.
Workaround
When I changed
-Xmx2g
to-Xmx512m
everything worked fine and I was able to build.Question(s)
java32flags()
function inutils
? In other words, if it's a 32 bit JVM should the max heap flag be reduced, whereas 64-bit JVM could state the same?... either way I'm glad I finally got past this issue at least locally.
The text was updated successfully, but these errors were encountered: