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

Basic first-run installation tasks fail on Ubuntu 18.04 with 16 GB of memory, 7GB free #556

Closed
mikaelhg opened this issue Jul 20, 2018 · 2 comments

Comments

@mikaelhg
Copy link

mikaelhg commented Jul 20, 2018

Trying to perform basic first-run installation tasks immediately fails on Ubuntu 18.04 with 16 GB of memory, of which 7 GB is available. The same also happens natively, without the Docker container, but it's handier for reproduction.

Step 6/7 : RUN bin/gu install python
 ---> Running in 78c0b49ce4f8
Downloading: Component catalog
Processing component archive: Component python
Downloading: Component python
Installing new component: Graal.Python (org.graalvm.python, version 1.0.0-rc4)

IMPORTANT NOTE:
---------------
Set of Graal VM components that provide language implementations have changed. The Polyglot native image and polyglot native C library may be out of sync: 
- new languages may not be accessible
- removed languages may cause the native binary to fail on missing resources or libraries.
To rebuild and refresh the native binaries, use the following command:
        /graal/jre/bin/gu rebuild-images


Removing intermediate container 78c0b49ce4f8
 ---> 303b0afe5e0c
Step 7/7 : RUN bin/gu rebuild-images polyglot
 ---> Running in c44218fceb90
Building polyglot...
   classlist:   3,255.61 ms
       (cap):   1,077.35 ms
       setup:   3,360.95 ms
GraalVM 1.0.0-rc4 warning: INFO: os::commit_memory(0x0000000523180000, 2804416512, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2804416512 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /graal/hs_err_pid47.log
Error: Image building with exit status 1
The command '/bin/sh -c bin/gu rebuild-images polyglot' returned a non-zero code: 1

Right after the crash:

$ free -m
              total        used        free      shared  buff/cache   available
Mem:          15979        8129        6746         569        1102        6950
Swap:          2047        1861         186

Dockerfile available at https://github.com/mikaelhg/nobody-has-tested-basic-graal-installation.

Build command:

docker build -t graal-installation https://github.com/mikaelhg/nobody-has-tested-basic-graal-installation.git
@mikaelhg
Copy link
Author

In the reddit thread someone mentioned that the free memory requirement for building polyglot images is approximately 10 Gb.

@mikaelhg
Copy link
Author

mikaelhg commented Aug 6, 2022

Closed as outdated.

@mikaelhg mikaelhg closed this as completed Aug 6, 2022
jerboaa added a commit to jerboaa/graal that referenced this issue Sep 1, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: oracle#556
jerboaa added a commit to jerboaa/graal that referenced this issue Sep 4, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: oracle#556
jerboaa added a commit to jerboaa/graal that referenced this issue Sep 13, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: oracle#556
zakkak pushed a commit to zakkak/mandrel that referenced this issue Sep 14, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: oracle#556
jerboaa added a commit to jerboaa/graal that referenced this issue Sep 22, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: oracle#556
jerboaa added a commit to jerboaa/graal that referenced this issue Sep 22, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: oracle#556
zakkak pushed a commit to zakkak/mandrel that referenced this issue Oct 10, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: oracle#556
(cherry picked from commit 1ae2dc0)
zakkak pushed a commit to zakkak/mandrel that referenced this issue Nov 13, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: oracle#556
(cherry picked from commit 1ae2dc0)
graalvmbot pushed a commit that referenced this issue Dec 7, 2023
First, we use a separate accessor for page-alignedness as it doesn't
need the more sophisticated initialization of the directMemory field.

Next, ensure PhysicalMemory initialization is serialized and when it is,
set directMemory to a static value so that the container code can finish
initialization without introducing a cyle. The final directMemory value
based on the heap size is then published to JDK code by setting the VM
init level to 1. Therefore, application code would use the non-static
value as the upper bound.

Closes: #556
(cherry picked from commit 1ae2dc0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant