JEP draft: Linux/musl libc Port

OwnerAleksei Voitylov
TypeFeature
ScopeImplementation
StatusDraft
Componenthotspot / runtime
Discussionportola dash dev at openjdk dot java dot net
EffortM
DurationM
Created2019/08/13 10:33
Updated2019/08/13 21:33
Issue8229469

Summary

Port JDK to Linux/musl libc and enable JDK on Alpine Linux x86_64.

Motivation

Musl libc is an implementation of the standard library functionality described in the ISO C and POSIX standards intended for Linux-based systems. Several Linux distributions including Alpine Linux are based on musl libc and others provide optional musl package, e.g. OpenWrt and Arch Linux.

Alpine Linux distribution is widely adopted in cloud deployments, microservices and container environments due to small image size (under 6 MB for Docker base image). Enabling Java to run out of the box on such deployments will naturally allow Tomcat, Jetty, Spring and other popular frameworks to eventually support such platforms natively.

By additionally using jlink to further reduce the size of the Runtime a user would be able to create a smaller Runtime targeted to run a specific application. The set of modules required by an application can be determined by jdeps command. For example, if a target application only depends on java.base module, base Docker image with Alpine Linux and a Runtime with java.base module and Server VM would fit in 38 MB.

The same motivation applies to Embedded deployments where size constraint is also an issue.

Description

This JEP intends to integrate the Portola Project upstream. The Portola Project is led by Oracle and contains patches from several external contributors. Several OpenJDK support vendors (Azul, BellSoft) have been shipping production-ready binaries with musl libc support for LTS releases which justifies the demand and maturity of the musl libc port. The intent is to continue supporting it going forward once the code is integrated upstream.

Alternatives

Keep the musl libc port downstream in Portola project.

Testing

Risks and Assumptions