You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
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.
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
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)
Given the nature of how this JVM is being used, is 2GB max heap really necessary, or can it be reduced to 512MB?
Should this be handled in the java32flags() function in utils? 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.