Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Memory allocation failed - OS: Ubuntu 18.04.2 LTS on Windows 10 #256

Closed

Description

@incube8r

When trying to configure an app on Ubuntu 18.04 on Windows error occurs:

# curl -X PUT [email protected] '127.0.0.1:8443/config/'   
{ 
        "error": "Memory allocation failed."
}

OS: Ubuntu 18.04.2 LTS on Windows 10
Kernel: 4.4.0-17763-Microsoft

Activity

  1. VBart commented on May 28, 2019

    @VBart
    Contributor

    Thank you for the report. Could you please check, what's in the unit.log?

  2. incube8r commented on May 29, 2019

    @incube8r
    Author

    @VBart after the curl put the log appends this:

    2019/05/29 13:42:01 [alert] 33#33 *4 memfd_create(/unit.33.fb8f291) failed (38: Function not implemented)

  3. VBart commented on May 29, 2019

    @VBart
    Contributor

    @incube8r So the problem is that Microsoft WSL implementation of Linux API incomplete.
    You can try to avoid this issue by recompiling Unit with disabled memfd_create() syscall:
    ./configure --cc-opt='-DNXT_HAVE_MEMFD_CREATE=0'

  4. incube8r commented on May 29, 2019

    @incube8r
    Author

    I did:

    $ ./configure java --module=java8
    configuring Java module
    checking for java executable found /usr/bin/java
    openjdk version "1.8.0_212"
    OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
    OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
    checking java.home /usr/lib/jvm/java-8-openjdk-amd64/jre
    adjust java.home /usr/lib/jvm/java-8-openjdk-amd64
    checking library path /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
    checking for JNI ... found
     + Java module: java8.unit.so
    
    

    Then

    make

    Then when I do

    $ curl -X PUT [email protected] '127.0.0.1:8443/config/'
    { 
            "error": "Invalid configuration.",
            "detail": "The module to run \"java 8\" is not found among the available application modules."
    }
    

    I won't run java

    What could be missing here?

  5. mar0x commented on May 29, 2019

    @mar0x
    Contributor

    Please provide all commands you are using to configure/make/run unit.
    If you running unit from packages, it is better to use pre-built java module.

  6. VBart commented on May 29, 2019

    @VBart
    Contributor

    @incube8r You have to make install your module into the modules directory. You can check the modules directory path by running unitd --help command.

  7. incube8r commented on May 29, 2019

    @incube8r
    Author

    @VBart thanks, I can confirm here that using the ./configure --cc-opt='-DNXT_HAVE_MEMFD_CREATE=0'

    I was able to run a Java web app with NGINX on Ubuntu 18.04 on Windows 10

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions