Skip to content

Alibaba Dragonwell 11 User Guide

joeyleeeeeee97 edited this page Nov 11, 2021 · 22 revisions

Introduction

Over the years, more than a billion lines of Java code have been written in Alibaba. While adopting OpenJDK to run these applications, we have found a need to customize it specifically for large-scale Java application deployments. Our customization has been well tested in our environment. We are now contributing some of our work into the Java community.

Alibaba Dragonwell, as a downstream version of OpenJDK, is optimized for online e-commerce, financial and logistics applications running on 100,000+ servers. Alibaba Dragonwell is the engine that runs these distributed Java applications in extreme scaling. Alibaba Dragonwell is a "friendly fork" under the same licensing terms as the upstream OpenJDK project. Alibaba is committed to collaborate closely with the OpenJDK community. We intend to bring as many customized features as possible from Alibaba Dragonwell to the upstream.

Using Alibaba Dragonwell 11

Installation

More mirror sites for download

  • Uncompress the package to the installation directory.

Enable Alibaba Dragonwell for Java applications.

To enable Alibaba Dragonwell JDK for your application, simply set JAVA_HOME to point to the installation directory of Alibaba Dragonwell.

JFR Object Allocation Profiling

Download JMC tools: Linux, OSX, Windows

Use -XX:FlightRecorderOptions=sampleobjectallocations=true to enable this feature, which allows to sample object allocation happened in C2 compiler. Users can use -XX:FlightRecorderOptions=sampleobjectallocations=true,objectallocationssamplinginterval=512 to set the sampling interval, the default value is 1024. Follow below steps to use this feature:

  1. Use jcmd <pid> JFR.start settings=ObjectProfiling.jfc name=MyRecording to start a JFR recording, the following configurations need to be set in ObjectProfiling.jfc:
<?xml version="1.0" encoding="UTF-8"?>
<configuration version="2.0">
  <event name="jdk.OptoInstanceObjectAllocation">
    <setting name="enabled">true</setting>
  </event>
  <event name="jdk.OptoArrayObjectAllocation">
    <setting name="enabled">true</setting>
  </event>
</configuration>
  1. Use jcmd <pid> JFR.stop name=MyRecording filename=dump.jfr to generate JFR dump file.

Users can use JMC to parse the JFR dump file and analyze the hot path of objects allocation. We did the following enhancements in JMC:

Add object profiling tab, used to identify the hot objects frequently allocated in C2 compiler:

Enhance the flame graph view to support aggregating the allocation thread stacks by allocation size:

How to open flame view:
1.Go to Window | Show View | Other...
2.Select Mission Control / Flame View

Serviceability

  1. Mini-Heapdump support With Alibaba Dragonwell you may dump partial Java heap by omitting the content of all primitive type arrays. A new option mini is added to the sub-command -dump of jmap tool. An example: jmap -dump:live,mini,format=b,file=heap121.bin <PID>

  2. -XX:ArrayAllocationWarningSize= The flag will print the calling stack of an array allocation if the allocation size is greater than the ArrayAllocationWarningSize. The default value is 512M, this flag could be enabled by jinfo:

// print the allocation stack if more than 1M array allocated.
jinfo -flag ArrayAllocationWarningSize=1048576 <pid>
// back to default value(512M)
jinfo -flag ArrayAllocationWarningSize=536870912 <pid>

Support

Please take a look at Alibaba Dragonwell FAQ for support. Or send mail to dragonwell_use@googlegroups.com for more help. Or you may scan QR code below with DingTalk to join the group chat(Number 35434688)