20 Years of Java
Transcript of 20 Years of Java
SafeHarborStatement
[Thisismystory,myexperiences.Officialandotherpeoples’versionsofeventsmayvary]
@lagergren
1991-1993• Project“Green”atSunMicrosystems
• Aportablearchitectureforhomeelectronics
• Remotecontrols?
1994• I’mstillatuniversity• ScrapedtogetherenoughmoneytobuildahighperformanceminitowerPC• Pentium90
• “Wow!CPUfrequenciesare,like,intheFMtheFMbandthesedays”
1994• AtthesametimeinSantaClara• Oakhasbetterapplicationsthanprogrammingremotecontrols
• DealwithNetscapefinalizing
1994• AtthesametimeinSantaClara• Oakhasbetterapplicationsthanprogrammingremotecontrols
• DealwithNetscapefinalizing• Writeonce/runeverywhere
1994• AtthesametimeinSantaClara• Oakhasbetterapplicationsthanprogrammingremotecontrols
• DealwithNetscapefinalizing• Writeonce/runeverywhere• “Networkaware”language
1995-1996• 1995wastheyearwhereInternetsuddenlymeant“TheWorldWideWeb”• 1996:JDK1.02• ThefirstJDKreleasedbySun
• JavainNetscapeNavigator
1996IworkedwithAlphasofJDK1.0atEricssonMedialab
TheJDKfitononeofthese[Sneakernet,backandforthtoKTHwheretherewasbandwidthandnotjustmy
v42’’modem]
1996• InternshipatEricssonMedialab• “PlaywithEricsson’sfuture”• Use“cuttingedgetechnology”todosomethingwithmediaondemand
1996• InternshipatEricssonMedialab• “PlaywithEricsson’sfuture”• Use“cuttingedgetechnology”todosomethingwithmediaondemand
1996• Java1.0• Purebytecodeinterpretation
• Universityprofessorsuddenlyproudofhisinterpretedtoylanguage,notashamedaspreviously
• “IfJavagetsawaywithit,Ican”• Butdidit?
1996• Java1.0• Purebytecodeinterpretation
• Universityprofessorsuddenlyproudofhisinterpretedtoylanguage,notashamedaspreviously
• “IfJavagetsawaywithit,Ican”• Butdidit?
• JavaMemoryModel(broken)
1996• Java1.0• Purebytecodeinterpretation
• Universityprofessorsuddenlyproudofhisinterpretedtoylanguage,notashamedaspreviously
• “IfJavagetsawaywithit,Ican”• Butdidit?
• JavaMemoryModel(broken)• Thread.stopandallitsfriends(@deprecated)
1996• Java1.0• Purebytecodeinterpretation
• Universityprofessorsuddenlyproudofhisinterpretedtoylanguage,notashamedaspreviously
• “IfJavagetsawaywithit,Ican”• Butdidit?
• JavaMemoryModel(broken)• Thread.stopandallitsfriends(@deprecated)• “Very1.0”
1996• “YourdevelopmentcycleismuchfasterbecauseJavais
interpreted.Thecompile-link-load-test-crash-debug-cycleisobsolete”
- JamesGosling
1996• “YourdevelopmentcycleismuchfasterbecauseJavais
interpreted.Thecompile-link-load-test-crash-debug-cycleisobsolete”
- JamesGosling
Wait!Isn’tthattheargumenttheJavaScriptkiddiesusetoday?
1996• AppealSoftwareSolutionsisfoundedinStockholm- AllmembershadextensiveJavaexperience,
havingusedthelanguagefromthestart- JavaConsulting- …and…*sigh*UML/RUP
1997• Javaontheclientsidenotreallytakingoff• Writeonce/runeverywheredoes,however• Andnobufferoverruns• Andnopointers• Andautomaticmemorymanagement• ==fastapplicationdevelopment• TheJDKisagreatlibraryfordevelopment
1997• Javaontheclientsidenotreallytakingoff• Writeonce/runeverywheredoes,however• Andnobufferoverruns• Andnopointers• Andautomaticmemorymanagement• ==fastapplicationdevelopment• TheJDKisagreatlibraryfordevelopment
• Thedawnofapplicationservers
1997• Javaontheclientsidenotreallytakingoff• Writeonce/runeverywheredoes,however• Andnobufferoverruns• Andnopointers• Andautomaticmemorymanagement• ==fastapplicationdevelopment• TheJDKisagreatlibraryfordevelopment
• Thedawnofapplicationservers• PrehistorictrailtowardJavaEE
1997• Java1.1• Innerclasses• JavaBeans• JDBC• RMI• LimitedReflection(nonruntime)• ThefirstJITs• (SymanteconWindows)
• SERIALIZATION– THEHORROR!
JavaOne1997• SunMicrosystemspresentstheHotSpotvirtualmachine– “WOW!Thisisthewaytodoit!Adaptiveruntimes!”
1998• JDK1.2• Swing• strictfp• JITintroducedintheclassicVM• CollectionsAPI• JDKtriplesinsize:1520classes,59packages
1998• JDK1.2• Swing• strictfp• JITintroducedintheclassicVM• CollectionsAPI• JDKtriplesinsize:1520classes,59packages
JavaOne1998• SunMicrosystemspresentstheHotSpotvirtualmachineagain– “WTF!Thisisslide-by-slidetheexactsamepresentationaslastyear!?!”
–Wecan’twaitanylonger.Let’sbuildourownVM.Howhardcanitbe?
Productizeanarrowerdomain?• Server-sideusageonly.Headless.–Weneedtohelptheearlyappservervendorsgetperformanceandscalability
Productizeanarrowerdomain?• Server-sideusageonly.Headless.–Weneedtohelptheearlyappservervendorsgetperformanceandscalability
• Nointerpreter– “startuptimedoesn’tmatterontheserveranyway”
1998• TowerJ• ExcelsiorJET• ConvertbytecodetoCcodeandrungcc• Fundementally incompatiblewitharuntimelanguage• Rakesin$$$anyway
1999• AppealSoftwareSolutionsfinanceJRockitdevelopment• HuntingforVC• InAugustwesellthefirstpartofoursouls• Wespendnightsreadingacademicpapers• Jalapeño(tobecomeJikes RVM)
2000• Javaisnowthefastestgrowingprogramminglanguageintheworld• Dotcombubble• NASDAQhits5.000justbeforethetechwreck
2000• TheJavaLicense• Youcan’tcallyourself“Java”withoutaJavalicense
• YouneedtopasstheTCKtestsuite– Notavailablewithoutlicense
• TogetaJavaLicenseyouneeda“valueadd”
TheJavaLicense• What’sa“valueadd”?– Superiorperformance!–What?Youdidn’tlikethat?– OK…Let’ssee…Err..“managability”
2000• JDK1.3“Kestrel”– HotSpot releasedbefore,April1999J2SEJVM– ButKestrelbundlesHotSpotwithJDK– JNDI– JPDA– RMI/Corba– JavaSound
2000• Q12000– JRockit 1.0released– “Very1.0”– NxMgreenthreadshybrid–Weactuallysellsomelicenses
• Wearestupidenoughtowriteitintheyearendfinancial statement
2001• AppealVirtualMachinesisbrokenoutfromAppealSoftwareSolutions
• AppealVirtualMachinesfinallygetsitsJavaLicense!
• “Managability valueadd”• Staticcompilermindsetstillverystrong• Veryhardtoselladaptiveruntimesasconcept
2001• BEAwantsperformanceandscalabilityYESTERDAY
• Wetaketimetohelpthemout• Startcooperatingonbenchmarks
2002• JDK1.4“Merlin”
– FirstplatformdevelopedunderJCP– assertkeyword– Regexps (sorta likePerlbutnotreally)– Exception.getCause()– NIO– LoggingAPI– ImageI/O– XML– IPv6
2002• Valentine’sday:BEAacquiresAppealVirtualMachines
• Now:howdowemakemoney?• Eventuallywefound4valueadds
2002• Valentine’sday:BEAacquiresAppealVirtualMachines
• Now:howdowemakemoney?• Eventuallywefound4valueadds
2002• Valueadd#2–Managability– JSRworksstartsonJSR-174–ManagementconsoleisthefirstpartofJavaMissionControltogetoutthere
2003-2004• Somehardwareobservationsareinorder– Clockratecurvesstarttoflattenout–Multicores,NUMA,hyperthreading
2003-2004• Somehardwareobservationsareinorder– Clockratecurvesstarttoflattenout–Multicores,NUMA,hyperthreading– JavastillhasexplicitThreads
2003-2004• Somehardwareobservationsareinorder– Clockratecurvesstarttoflattenout–Multicores,NUMA,hyperthreading– JavastillhasexplicitThreads– In-orderexecutionisabadideaforJITs
2003-2004• Somehardwareobservationsareinorder– Clockratecurvesstarttoflattenout–Multicores,NUMA,hyperthreading– JavastillhasexplicitThreads– In-orderexecutionisabadideaforJITs
ExecutionTime=RuntimeOverhead+ProgramRuntime
2004• JDK5.0(“Tiger”,JSR-176)
– Numberschemechangedfrom1.x– BiggestJavareleasesofar!– Generics– Annotations– Autoboxing/unboxing– Enums– Varargs (Object…)– Staticimports– java.util.concurrent
2004• x86_64released– nottheItanium,still64bit– ForthefirsttimeinhistoryAMDeatsIntel’slunch
– FullbackwardscompatibilitytowardsIA32– Adoption(recognizetheparalleltoJava)– Widerregisterbandwidth– 2xthenumberofregisters– EXABYTESofvirtualmemoryspace
TheBenchmarkWars• SPECjvm98wasthe benchmarksincetimeimmemorial
• SPECjbb2000,2005• SPECJAppServer• RunningSPECjbb2005isaquantifiablemanagementgoal
TheBenchmarkWars• Broughtrealworldoptimizations
– Compressedreferences– Noncontiguousheapsfor32bits– Externalandinternalheapcompaction– ConcurrentGC– Biasedlocking– Largepages– NUMA– Prefetch heuristics– Usingvectorized hardwareinstructionsSSE3/4– PartialEscapeAnalysis– Offheapstorageprototypes
TheBenchmarkWars• Broughtrealworldoptimizations
– Compressedreferences– Noncontiguousheapsfor32bits– Externalandinternalheapcompaction– ConcurrentGC– Biasedlocking– Largepages– NUMA– Prefetch heuristics– Usingvectorized hardwareinstructionsSSE3/4– PartialEscapeAnalysis– Offheapstorageprototypes
TheBenchmarkWars• Allthisfromafewsemi-syntheticbenchmarks
• CompetitionleadstoJavaserversideperformancebeingpushedtowhereit’sneverbeenbefore
• “Performancereleases”notalwaysgreatforstability,though
2004• MeanwhileatAppealVirtualMachines– Valueadd#3– DeterministicGC– QoS levelforpausetimes– Modernapplicationswantlowlatencyratherthanthroughput
– Telco,financesectorswentwild
2004• JSR-174getsfinalized• MissionControlshipswithitsfirstversions– Productiontimezerooverheadmonitoring– Limitedflightrecordings(JRA)– Extremelycheap– Justusedataavailablefromtheruntimealready
2006• SunMicrosystemsnotdoingalltoowell?• JavaFX isgoingon.–Mobilephonesareeverything.– Itgetsabitquietfromoursideofthescene.
2006• ApacheHarmony
– Needed torewriteclassesfromscratch– IBMandotherscontribute alotofcode
• AsksforJavalicensewhichitdoesn’tget– FieldofuserestrictionsclaimednotcompliantwithJCPrules
• VariousJCPfightsensue• SunopensupJVM/JDKsourcesunderGPLv2
2006• JDK6.0(December,JSR-270)“Mustang”– javax.scripting (builtinRhinointegration)
– CompilerAPI– JDBC4.0– Dynamiclanguages,JSR-292upforreview
2006• Dynamic languagesarebecomingtrendy• JRuby leadsthegrowth• JSR-292,invokedynamic• BEA,IBM,Sunallintheprocess
– Wecontributesubstantiallytothespec• ThepolyglotJVMeffortisstartingtobecoordinated• Bytecode isbasically serializedJava
– Noruntime-onlydispatch
2006• Virtualization isbecomingtrendy• “TheJVMisjustaspecializedoperatingsystemforrunningJava”
• BEAStartsbuildingJRockit VirtualEdition(VE)– Valueadd#4
2006• WhyisvirtualizedJavapowerful?
– Removalofabstraction– ZerocopyI/O– Moveeverythingwecantouserland– Minimizesyscalls– Threadscanprotectmemoryfromotherthreads
• CheapreadbarriersforlowlatencyGC!– Butdevicedrivers?– That’swhatwehavetheHypervisorfor– Heavilyencouragedbytheinvestmentbankingindustry
2007• ApacherequestsTCK• TheJCPstalls• JRockit needstohedgeitsbets,andcanrunHarmonyafterafewmonths
• BEA/SunJavalicensediscussions• Nolanguageupdatesfortheforseeablefuture?
2008• OracleacquiresBEA• JRockit engineeringworkscloselywithExaData andtheOracleserverstacks
• JRockit becomesdefaultOracleJVM
2008• OracleacquiresBEA• JRockit engineeringworkscloselywithExaData andtheOracleserverstacks
• JRockit becomesdefaultOracleJVM• OracleforcesthemovefromVMWare toXen forJrockit VE.
2011• Sadly,stillnonewJavareleasesince2006• IBMjoinstheOpenJDK• Harmonyretires• MarcuscomesbacktotheLanguageteam
2011• Java7“Dolphin”
– Plan“A”– Initial(native)implementationofinvokedynamic bytecode– Compressedoopsdefault– ProjectCoin
• Try-with-resource,switchonstrings,binaryliterals,underscores,multicatchwith|separators
– Concurrencyutilitiesfinalized(JSR-166)– NIO-2(JSR-203)
2011• Java7extremelywellreceivedbycommunity!
• Tippingpointandcommunitygoodwill• Oracle’ssecondJavaOne extremelywellreceived
JVMArchitectureobservation• Wehavethebackwardscompatibility still• Wewillalwaysmaintainit– Insomeways,thingsmightchange,e.g.Jigsaw,butfundamentalcompatibilitywillalwaysbethere
2011-2012• Java8developmentstartspickingupspeed
• Nashorn projectofficiallystarts• JMC/servicability porttoHotSpotcompletes,partofJava8(7u40)
• Betterbuildandtestinfrastructure
2014• Java8(releasedMarch18)– BiggestandbestJavareleaseever– Permgenremoval– Typeannotation– Unsignedintegermath– Repeatedannotations– DateandTimeAPI(JSR-310)– Nashorn
2014List<?> costBeforeTax =Arrays.asList(100, 200, 300, 400, 500);
for (Integer cost : costBeforeTax) { double price = cost + .25*cost; System.out.println(price);
}
2014List<?> costBeforeTax =Arrays.asList(100, 200, 300, 400, 500);
costBeforeTax.stream().map((cost) -> cost .25*cost).forEach(System.out::println);
2014List<?> costBeforeTax =Arrays.asList(100, 200, 300, 400, 500);
costBeforeTax.parallelStream().map((cost) -> cost .25*cost).forEach(System.out::println);
2015• Java9intheworks– Jigsaw– JShell REPL(ProjectKulla)– Nashorn partialES6support,hugeperformanceimprovements
2015• AfterJava9– Valuetypes(projectValhalla)– Foreignfunctioninterface(projectPanama)– Arrays2.0– DeterministicandLowLatencyGC– MoreopensourceJVMimplementations:J9,dynamiclanguageapplications.