Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 •...

36
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Java SE 9: ConDnuing to Thrive in the Cloud! Bernard Traversat Vice President of Engineering Java SE PlaKorm, Oracle Nov 8th, 2016

Transcript of Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 •...

Page 1: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaSE9:ConDnuingtoThriveintheCloud!

BernardTraversatVicePresidentofEngineeringJavaSEPlaKorm,OracleNov8th,2016

Page 2: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

WhoamI?

2

•  VPofEngineeringatOracle-managingtheJavaSEdevelopmentteam

–EverythingdeliveredaspartoftheJDK/JRE–EverythingdevelopedinOpenJDK

•  PreviouslyatSun,startedtoworkonJavain1998ontheJavaOSproject

•  Before,IworkedatNASAAmesonoperaDngsystemsformassivelyparallelsupercomputers

Page 3: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

SafeHarborStatementThefollowingisintendedtooutlineourgeneralproductdirecDon.ItisintendedforinformaDonpurposesonly,andmaynotbeincorporatedintoanycontract.Itisnotacommitmenttodeliveranymaterial,code,orfuncDonality,andshouldnotberelieduponinmakingpurchasingdecisions.Thedevelopment,release,andDmingofanyfeaturesorfuncDonalitydescribedforOracle’sproductsremainsatthesolediscreDonofOracle.

3

Page 4: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Agenda

JavaAdopDon

JavaintheCloud

JavaSE9

1

2

3

4

Page 5: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaSEis#1withDevelopers

5

•  Java8demonstratedthatwehaveovercomeandreversedoverallpercepDonofJavadecline

•  Java8adop,onisskyrocke,ng!

Page 6: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaSEis#1RunDmeintheCloud

6

•  #1DeploymentrunDmeonAWSandGoogleAppEngineand#3onMSAzure

•  JavaRunDmeisthefoundaDonoftheCloudIaaS,PaaSandSaaS

Page 7: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

WhyJavaWillConDnuetoThriveintheCloud•  Security&Vulnerability

–  SecuritybuiltdeepintheJVMrunDme(bytecodeverificaDon,managedpointers&managedmemorylayout)–  Securitybuiltinthelanguage(strongtypingandAPIencapsulaDon)–  UpcominghardwaresecurityinnovaDons(frompagestopointeraddresses,encrypDonatmemoryspeed)

•  EfficiencyandulDmateperformance–  DynamicJITcompilaDon(opDmizeandde-opDmizaDonJVMmachinery,profiledrivenopDmizaDon)–  Scalability(from1thread/coreto10,000sthreads/cores,fromafewGBstomulDpleTBs)–  CloudisallaboutuDlitycompuDng(operaDngcostwillsoondominateCloudmarket!)

•  Increasedeploymentvelocity–  Thecloudisdemandinganaccelerateddeploymentcycle(hour/day/weekvsmonth/year)–  Increasepressuretouptakenewreleases(security,criDcalfixes&performance)–managebackwardcompaDbility!!!!–  Thrivetowardsanhomogeneousanduniformsokwareinfrastructure(lowermaintenancecost)

•  Manageabilityandserviceabilityatscale–  Expressibility&Readability–  Maturetoolingecosystems–  Dynamicpatching(noservicedownDme,classredefiniDon,JVMsafepointredefine)

7

Page 8: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

ChallengestoEvolvingTheJavaPlaKorm

•  2TrillionlinesofcodeinproducDon– EnsuringbackwardcompaDbilityisabigdealtoourusers,toyouandus:-)

• Decisionsmade20yearsagomaynotapplyanymore– DualitybetweenObjectandPrimiDvetype

•  Foreseeingthefuture– Manydecisionsmadetodaymay/willhaveprofoundimpacts10yearsfromnow

• Maintainingthe“lookandfeel”ofJava

8

Page 9: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaPlaKormFeatureBacklog

9

Page 10: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

UnderstandingJavaDevelopersMainPainPoints

10

•  Tooverbose•  Usetoomuchmemory•  Tooslow•  Dynamicallylinked•  Etc.

Page 11: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

MaintainingJavaCorePrinciples

11

•  Consistency•  Predictability•  Easytoread•  CompaDbility

Page 12: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

JavaSEPlaKormInvestments•  Securityisour#1priority

–  DeliverthemostsecureJavarunDmefortheCloudandnextgeneraDonhardware•  ImprovingJavadeveloperproducDvityandcompaDbility

–  MakeJavadevelopersmoreefficientandensureeasierpathtouptakenewreleasesquicker–  ProgramoncefortheCloudandscaleupasneeded

•  Increasingdensity–  ReducingmemoryusageandsharemoredatabetweenJVMprocesses–  LargestimpacttoreducingourcustomersandourcloudoperaDngcost

•  ImprovingstartupDme–  Enablinglighter-weightservicesandcontainers(microserviceandClouddevopsusecases)

•  Improvingpredictability–  Lower,morepredictableGCpauses,evenforverylargeheaps(TB+)

•  Simplifyingserviceabilityandprofiling–  ManagingandtuningJVMdeploymentsatscale

Page 13: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Java9“OneModular,UpgradeablePlaKormfortheCloud”

Page 14: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Java9JEPs

h;p://openjdk.java.net/projects/jdk9/

14

102:ProcessAPIUpdates110:HTTP2Client143:ImproveContendedLocking158:UnifiedJVMLogging165:CompilerControl193:VariableHandles197:SegmentedCodeCache199:SmartJavaCompilaDon,PhaseTwo200:TheModularJDK201:ModularSourceCode211:ElideDeprecaDonWarningsonImportStatements212:ResolveLintandDoclintWarnings213:MillingProjectCoin214:RemoveGCCombinaDonsDeprecatedinJDK8215:TieredAsribuDonforjavac216:ProcessImportStatementsCorrectly217:AnnotaDonsPipeline2.0219:DatagramTransportLayerSecurity(DTLS)220:ModularRun-TimeImages221:SimplifiedDocletAPI222:jshell:TheJavaShell(Read-Eval-PrintLoop)223:NewVersion-StringScheme224:HTML5Javadoc225:JavadocSearch226:UTF-8PropertyFiles227:Unicode7.0228:AddMoreDiagnosDcCommands229:CreatePKCS12KeystoresbyDefault231:RemoveLaunch-TimeJREVersionSelecDon232:ImproveSecureApplicaDonPerformance233:GenerateRun-TimeCompilerTestsAutomaDcally235:TestClass-FileAsributesGeneratedbyjavac236:ParserAPIforNashorn237:Linux/AArch64Port238:MulD-ReleaseJARFiles240:RemovetheJVMTIhprofAgent241:RemovethejhatTool243:Java-LevelJVMCompilerInterface

244:TLSApplicaDon-LayerProtocolNegoDaDonExtension245:ValidateJVMCommand-LineFlagArguments246:LeverageCPUInstrucDonsforGHASHandRSA247:CompileforOlderPlaKormVersions248:MakeG1theDefaultGarbageCollector249:OCSPStaplingforTLS250:StoreInternedStringsinCDSArchives251:MulD-ResoluDonImages252:UseCLDRLocaleDatabyDefault253:PrepareJavaFXUIControls&CSSAPIsforModularizaDon254:CompactStrings255:MergeSelectedXerces2.11.0UpdatesintoJAXP256:BeanInfoAnnotaDons257:UpdateJavaFX/MediatoNewerVersionofGStreamer258:HarfBuzzFont-LayoutEngine259:Stack-WalkingAPI260:EncapsulateMostInternalAPIs261:ModuleSystem262:TIFFImageI/O263:HiDPIGraphicsonWindowsandLinux264:PlaKormLoggingAPIandService265:MarlinGraphicsRenderer266:MoreConcurrencyUpdates267:Unicode8.0268:XMLCatalogs269:ConvenienceFactoryMethodsforCollecDons270:ReservedStackAreasforCriDcalSecDons271:UnifiedGCLogging272:PlaKorm-SpecificDesktopFeatures273:DRBG-BasedSecureRandomImplementaDons274:EnhancedMethodHandles275:ModularJavaApplicaDonPackaging276:DynamicLinkingofLanguage-DefinedObjectModels277:EnhancedDeprecaDon278:AddiDonalTestsforHumongousObjectsinG1279:ImproveTest-FailureTroubleshooDng280:IndifyStringConcatenaDon281:HotSpotC++Unit-TestFramework282:jlink:TheJavaLinker283:EnableGTK3onLinux284:NewHotSpotBuildSystem285:Spin-WaitHints287:SHA-3HashAlgorithms289:DeprecatetheAppletAPI

•  ThebigDcketitemforjava9isModularizaDon(akaJigsaw)

• Currently121enhancements(JEPs)– 114integrated,completedandclosed– 7incandidate,proposedtodropandtargeted

• NewEAbuildavailableeveryotherweek

Page 15: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Java9JigsawModularity

•  JavaSE&itsimplementaDonshistoricallymonolithic– Clouddeploymentsmostokendon’trequiretheenDreplaKorm

•  BackwardcompaDbilityrequiresstrongAPIencapsulaDon• Moduleswilldefineamodule-info.javafile

– Declaresitsdependencies(requires)– Declareswhatpackagesitgivesexternalaccessto(exports)

•  SimpleExample:module com.foo.bar { requires com.foo.baz; exports com.foo.bar.alpha; exports com.foo.bar.beta; }

15

Page 16: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|Copyright©2015,Oracleand/oritsaffiliates.Allrightsreserved.

JDK9JigsawSecurity:ModuleboundariesenforcedbytheJVM

•EncapsulateimplementaDon---internalclassesinsidemodules– SharethemwithotherimplementaDonmodulesonlyasneeded

•  Massivemaintainabilityimprovement•  SimplercompaDbilityupgradepath

•  WeandYoucannowhideandprecludeaccesstounsupportedinternalAPIsandimplementaDon

•  WillalsosignificantlyimproveSecurity•  EnabledeveloperstocreatecustomizedrunDmethatremovedunusedsecurity

sensiDveAPIs

12

Page 17: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|Copyright©2015,Oracleand/oritsaffiliates.Allrightsreserved.

Java9:JigsawNewLinkingPhase

• Introduceanewdevelopmentphase:Linking

–AkerJavaccompilaDon,butbeforepackaginganddeployment–jlinklinkingtooltoconsumeapplicaDonclasses aswellasplaKormmodules–LinkercanproducecustomrunDmeimagesinvariousformats • Regularimages(astoday) • JVM---specificmemoryimages(CDSarchives) • “Fastexecutablebinaries”(self---containednaDveexecutablecode)

Demo

9

Page 18: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Java9:AheadofTime(AOT)JavaCompiler

18

• TheunificaDonofstaDcanddynamiccompilaDon– StaDccompilaDon–fasterstartup,lowermemoryusage,butlimitedinopDmizingcodegeneraDon

– DynamicprofilingbasedcompilaDon–slowstartupbutopDmumcodegeneraDon

• NewAOTCompilertostaDcallycompileJavaclassestonaDvesharedlibraries– ReducesstartupDmeandimprovedensitytoclosethegapagainstnaDveservice

• CompileJavapackagestonaDvesharedlibraries•  JVMwasmodifiedtoloadnaDvesharedlibrariesonstartup

–  JVMinternalstructures,whichdescribecompiledcode,aresplittodescribecompiledcodeincodecacheandinasharedlibrary

– AOTcompiledcodeisdynamicallylinkedtoJavamethodsakeritsclassisiniDalized

Page 19: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Java9:AheadofTime(AOT)JavaCompiler

19

•  NewJDKtool‘jaotc’isaddedaspartofjavainstallaDon.‘jaotc’isjavastaDccompilerwhichproducesnaDvecodeforcompiledjavamethods.Ituseslibelfforproducing.soAOTlibraries.Touse‘jaotc’userhavetospecify.class,.jarfilesorjavamodulenameasinputandresulDngAOTlibrarynameasoutput:

jaotc--outputlibHelloWorld.soHelloWorld.class

jaotc--outputlibjava.base.so--modulejava.base

•  Usercanspecifywhichmethodstocompileorexcludewith—compile-commandsflag

jaotc--outputlibjava.base.so—compile-commandsbase.txt—modulejava.base

•  DuringJVMstartuptheAOTiniDalizaDoncodelooksforsharedlibrariesin($JAVA_HOME/lib)orlibrariesspecifiedby-XX:AOTLibraryopDon.Ifsharedlibrariesarefound,theseareloadedandused.

java-XX:AOTLibrary=./libHelloWorld.so,./libjava.base.soHelloWorld

Page 20: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

JDK9-WhatisJShell?•  ToolprovidingadynamicinteracDonwiththeJava™programminglanguageintheCloud

• Read-Evaluate-PrintLoop(REPL)fortheJava™plaKormintheCloud– TypeinasnippetofJavacode,seetheresults

• DeeplyintegratedwithJDKtool-set– StayscurrentandcompaDble

• Also,aninteracDveAPIforusewithinotherapplicaDons

20

Page 21: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

WhatisJShellNOT?• Notanewlanguage

– “Snippets”ofpure– Nonewsyntax

• Notareplacementforthecompiler• NotanIDE

21

Page 22: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

WhowantsJShell?• NewtoJava,newtoprogramming

– Startwithexpressionsvsclasses– Immediatefeedback

•  ExploringanewAPIorlanguagefeature– Experimentandinstantlyseeresults

• PrototypingandinteracDvity– Incrementallywritecomplexcode

22

Page 23: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

WithJShell•  Typeina“snippet”ofcode•  Immediatelyseeitsbehavior

DEMO

23

Page 24: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Java9-G1GarbageCollectorastheDefault

•  MulD-yearefforttodelivernextgeneraDonGCimprovements

•  GCpause-DmeshavethelargestimpactonapplicaDonperformance,predictabilityandresponsiveness

•  G1usesoneconDguousheapspacedividedintomanyfixedsizeregions(analogtopagesinVMOS’s)

–  Per region scalable collection process–  Sizecanbe1MB–32MB

–  NewarchitecturetoscaleuptomulD-TBheap

●  EachregioncanbeassignedauniqueevicDon/compacDonpolicy(Edenregion,Survivorregion,HumongousorOldregion)

E S

O O

O O

O O

O O O

O

O O O

O H O

S

S S

E E E

E

E E

H

O

H

O

E S

Eden regions

Survivor regions

Old generation regions

H Humongous regions

Available / Unused regions

Page 25: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

•  Commercialfeaturetoreducesphysicalmemoryusageforloadedclasses•  FasterstartupDmeduetopre-loadedclassmetadata.•  SharesofclassmetadataacrossJVMprocesses.•  AppCDSstoresclassmetadatainaJavaSharedArchivefile(JSA)

–  bytecodes,fieldtables,methodtables,etc.

•  JVMwasmodifiedtoloadmoreefficientlytheseSharedArchivefiles• MulDpleJVMprocessescanmemory-mapthesameJSAfile

– MemoryintheJSAfileissharedacrossprocesses– MemoryissplitintoRead-Only(shared)andRead-Write(Copy-on-Write)

What is AppCDS?

Page 26: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Page 27: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.| 27

Page 28: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.| 28

Page 29: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

StringDensity•  TheStringClassstorescharactersusingaUTF-16encoding(use2bytespercharacter)– But,thevastmajorityofJavaappsreallyuseonlysinglebytecharacters

• Consequence– Lotsofwastedspace/memory

•  JDK9feature(JEP254)– ModifytheJVMrunDme,JIT,GCandStringclasstotransparentlyopDmizetheinternalcharacterencoding(usesinglevsmulD-bytes)

– Requirements•  Reducememoryfootprint,yetnotsacrificethroughputperformance•  NoAPIchange,nore-compilaDonorcodemodificaDonsrequiredbyupstreamFMWorFusionAppstorealizebenefit

•  SupportonX86/x64,SPARCandLinux,Solaris,Windows,OSX

29

Page 30: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

DensityString

30

•  Analyzednearly1,000’sheapprofiles–  VastmajorityofcharactersinJavaStringsaresinglebytechars

–  75%ofStringsaresmallerthan35Characters

–  75%ofCharactersareinStringsofLength<250

–  5%-20%memoryfootprintreducDonopportunityperapplicaDon

•  Specjbb2005– 21%memoryfootprintreduc,on– 27%lessGCs– 5%throughputimprovement

Page 31: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

FlightRecorderPerformance

• BuiltintotheJVM/JDK,bythepeopledevelopingtheJVM•  Lessthat1%overheadinproducDondeployment• HighperformanceflightrecordingengineandhighperformancedatacollecDon

–  AccesstodataalreadycollectedintheJVMrunDme–  ThreadlocalnaDvebuffers–  InvariantTSCforDmestamping– Moreaccuratemethodprofiling(methodprofilingdataevenfromoutsidesafe-points)

–  FasterandmoreaccurateallocaDonprofiling

ExtremelyLowOverhead

Page 32: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Beyond9

Page 33: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

TheNextBigChallenge:ObjectDatalayout

•  JavaisverygoodatopDmizingcode,lesssoatopDmizingdata– Memoryoverhead,lessthanopDmalperformance,difficulttouDlizemodernhardware

•  Java’stypesystemgivesusprimiDves,objects,andarrays– Veryflexible!Canmodelalmostanything.

•  Butflexibilityisnotexactlywhereweneedit– PrimiDvesareveryrigid– Objectsaremoreflexiblethanwealwaysneed

•  Thebigproblem:objectidenDty– Neededforpolymorphism,mutability– Notallobjectsneedit,butallobjectspayforit

Page 34: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

ImprovedJava/NaDveInteroperability

34

• BigDataHadoopandSparkarehighlydependentonnaDvelibraries–  Thesedependencieswon’tgoaway

•  OSI/0entries,GPUBLAS/LAPACK,AVX/Crypto/CRCintrinsics–  InteracDngwithNaDvelibraryfromJavaishardatbest–  JNIiscomplex,slowandhardtosecure-trueforcode,aswellasfordata

• Meanwhile,Javahassignificanttechnicaldebtsinsupportofforeigncalls–  APIsexportdatastructurelayouts(structstat)whicharehardtotraverse–  The“culturalpracDces”(likesafety)aredifferentbetweenJavaandC

• ProjectPanama-provideaneasier,saferandfasterJNI–  AddingForeignFuncDonandforeigndatasupporttoJava(FrozenArrays,VectorAPIandArrays2.0)–  AutomaDctypetranslaDon(naDvevs.carrier/javatypes)–  Nounsafe–providessafeAPIstoaccessnaDvedata/funcDons

Page 35: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java

Copyright©2016,Oracleand/oritsaffiliates.Allrightsreserved.|

Summary•  JavaSEadopDonisthrivingintheCloudandwillconDnue!• NeedyourhelponprovidingfeedbackonJava9

– h;ps://jdk9.java.net/download/• Beyond9,wehaveasolidtechnicalroadmap•  Let’sconDnuetoinnovateandadvancetheJavaSEPlaKormonOpenJDKtogether!

Page 36: Java SE 9: ConDnuing to Thrive in the Cloud! · Java 9: Ahead of Time (AOT) Java Compiler 19 • New JDK tool ‘jaotc’ is added as part of java installaon. ‘ jaotc’ is java