Oracle’s latest edition for Java – Java 8 was released in March 2014. As usual, tons of new features have been added. There is one major change in the Memory management area that I want to discuss today.

“So long PermGen, Hello Metaspace !!”

Oracle has completely gotten rid of ‘PermGen’ and replaced it with Metaspace.

What is PermGen ?

Short form for Permanent Generation, PermGen is the memory area in Heap that is used by the JVM to store class and method objects. If your application loads lots of classes, PermGen utilization will be high. PermGen also holds ‘interned’ Strings

The size of the PermGen space is configured by the Java command line option -XX:MaxPermSize

Typically 256 MB should be more than enough of PermGen space for most of the applications

However, It is not unusal to see the error “java.lang.OutOfMemoryError: PermGen space if you are loading unusual number of classes.

Gone are the days of OutOfMemory Errors due to PermGen space. With Java 8, there is NO PermGen. That’s right. So no more OutOfMemory Errors due to PermGen

The key difference between PermGen and Metaspace is this: while PermGen is part of Java Heap (Maximum size configured by -Xmx option), Metaspace is NOT part of Heap. Rather Metaspace is part of Native Memory (process memory) which is only limited by the Host Operating System.

So, what is the significance of this change?

While you will NOT run out of PermGen space anymore (since there is NO PermGen), you may consume excessive Native memory making the total process size large. The issue is, if your application loads lots of classes (and/or interned strings), you may actually bring down the Entire Server (not just your application). Why ? Because the native memory is only limited by the Operating System. This means you can literally take up all the memory on the Server. Not good.

It is critical that you add the new option -XX:MaxMetaspaceSize  which sets the Maximum Metaspace size for your application.

Note that it is no longer sufficient to just monitor the Heap Size. You must also monitor the Metaspace which you can do by just keeping an eye on the ‘process size’ using your Operating System utilities (Example: ‘top’ in Unix/Linux, ‘Task Manager’ in Windows).

Bonus Tip:

You can use the jmap command to print out Memory statistics of your current pre Java 8 application.

jmap -permstat <PID>

There you have it. With Java 8, PermGen is gone and Metaspace is in. Metaspace is part of Native Memory and NOT part of Java Heap. While this change may not be significant during development stage of the application, it is critical to consider this when going to production as you might not only bring down your application but bring down the entire server if your application eats up excessive Metaspace.

Make sure the Application Administrators and QA are made aware of this significant change and ensureadequate monitoring during QA phase (load testing) and in production.

source - http://karunsubramanian.com/websphere/one-important-change-in-memory-management-in-java-8/





source - https://www.slideshare.net/ValeriyMoiseenko/java-gc-offheap-workshop





The JVM keeps track of all data that is maintained by our software, and releases (frees) the memory once it is no longer needed, so that it can be used to store other data. The JVM frees memory by means of a process called garbage collection (GC). Garbage collection is a complex process, but generally it consists of locking the memory to avoid modification during garbage collection, finding the data that is no longer used (mark the garbage), and then freeing the memory associated with that data (sweep the marked garbage).

Different types of memory

In order to understand the memory related settings, some understanding of Java’s memory architecture is essential. The following figure provides an overview of Java’s memory architecture, and the different types of memory that are used:



The operating system (OS) has memory available, either as physical RAM, or as virtual memory. When Java is executed, the Java program (java executable on Linux and Mac, java.exe on Windows), becomes one of the running processes. The process uses a part of the operating system’s memory to store its data. This memory is called the Java process heap. The Java process heap is divided into two parts, the Java object heap and ‘Everything else’. The Java object heap contains all data actually used by the running Java program, which in our case is Eclipse and our own plugins. The ‘Everything else’ part contains various data, mostly used by the JVM internally.

Java uses a generational garbage collector. New data, called objects in Java, are created in the young generation, or more specifically, in its allocation space (also called eden space). When the young generation becomes full, the garbage collector will remove all garbage (no longer used data) using a minor collection, which removes garbage from the young generation. The garbage collector uses the survivor spaces to store the surviving objects. Objects that survive a few minor collections are moved to the old generation, which stores the longer living objects, as well as the larger objects that don’t fit in the young generation, which is usually much smaller than the old generation. When the old generation becomes full, the garbage collector performs a major collection removing garbage from the entire Java object heap, which is much more work, and thus much more costly than a minor collection.

The ‘Everything else’ part of the Java process heap contains various data used internally by the JVM. This includes the ‘Metaspace’ with all the Java code of Eclipse and our own plugins, the values of constants, etc. It also includes the native code, the highly optimized code generated for the specific architecture of your machine, that can actually be executed on your processor. Furthermore, it includes the stacksof all the threads that are running in parallel. There is also a part that contains the data maintained by the garbage collector itself, for administrative purposes. The ‘Everything else’ part contains various other types of data, that are irrelevant for the current discussion.


source - http://update.se.wtb.tue.nl/documentation/use/performance/tweak-perf-settings.html











'Development > Java' 카테고리의 다른 글

Java 8 - Memory Management  (0) 2018.09.16
Java - version history  (0) 2018.09.16
Java - Underscores in Numeric Literals  (0) 2018.08.11
java - Xms Xmx  (0) 2018.07.23
Java - Executor vs Thread  (0) 2018.07.20
Java 8 Date  (0) 2018.07.01
Posted by linuxism
TAG jvm, Memory


The Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java language has been governed by the Java Community Process (JCP), which uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The language is specified by the Java Language Specification (JLS); changes to the JLS are managed under JSR 901.

In addition to the language changes, much more dramatic changes have been made to the Java Class Library over the years, which has grown from a few hundred classes in JDK 1.0 to over three thousand in J2SE 5. Entire new APIs, such as Swing and Java2D, have been introduced, and many of the original JDK 1.0 classes and methods have been deprecated. Some programs allow conversion of Java programs from one version of the Java platform to an older one (for example Java 5.0 backported to 1.4) (see Java backporting tools).

In September 2017, Mark Reinhold, chief Architect of the Java Platform, proposed to change the release train to "one feature release every six months" rather than the current two-year schedule,[1][2] and later the proposal took effect.

Java 8 is the currently supported long-term support (LTS) version and Java 10 is the currently supported rapid release version, as of March 20, 2018. Java 10 support ends on the same date that support for Java 11 begins, planned for September 2018, and Java 11 will be the next LTS after Java 8. Java 7 is no longer publicly supported, Java 9 has stopped receiving updates since Java 9 was a short-term rapid release version that has been superseded by Java 10, and "end of public updates" for Java 8 is scheduled for January 2019 for commercial use, and not earlier than December 2020 for non-commercial use.[3]). For Java 11, long-term support will not be provided by Oracle, instead the broader OpenJDK community is expected to perform the work.[4]

VersionRelease
date
End of
Public Updates[5][6]
Extended
Support Until
JDK Beta1995??
JDK 1.0January 1996??
JDK 1.1February 1997??
J2SE 1.2December 1998??
J2SE 1.3May 2000??
J2SE 1.4February 2002October 2008February 2013
J2SE 5.0September 2004November 2009April 2015
Java SE 6December 2006April 2013December 2018
Java SE 7July 2011April 2015July 2022
Java SE 8 (LTS)March 2014January 2019 (commercial)
December 2020 (non-commercial)
September 2022 for OpenJDK
March 2025
Java SE 9September 2017March 2018N/A
Java SE 10 (18.3)March 2018September 2018N/A
Java SE 11 (18.9 LTS)September 2018March 2019 for Oracle
September 2022 for OpenJDK
Vendor specific
Java SE 12 (19.3)March 2019September 2019N/A
Legend:
Old version
Older version, still supported
Latest version
Future release

JDK 1.0[edit source]

The first version was released on January 23, 1996.[7][8] The first stable version, JDK 1.0.2, is called Java 1.[8]

JDK 1.1[edit source]

Major additions in the release on February 19, 1997 included:[9]

J2SE 1.2[edit source]

Codename Playground. The release on December 8, 1998 and subsequent releases through J2SE 5.0 were rebranded retrospectively Java 2 and the version name "J2SE" (Java 2 Platform, Standard Edition) replaced JDK to distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME (Java 2 Platform, Micro Edition). This was a very significant release of Java as it tripled the size of the Java platform to 1520 classes in 59 packages. Major additions included:[11]

J2SE 1.3[edit source]

Codename Kestrel. The most notable changes in the May 8, 2000 release were:[12][13]

J2SE 1.4[edit source]

Codename Merlin. The February 6, 2002 release was the first release of the Java platform developed under the Java Community Process as JSR 59. Major changes included:[14][15]

Public support and security updates for Java 1.4 ended in October 2008. Paid security updates for Oracle customers ended in February 2013.[16]

J2SE 5.0[edit source]

Codename Tiger. The release on September 30, 2004 was originally numbered 1.5, which is still used as the internal version number. The number was changed to "better reflect the level of maturity, stability, scalability and security of the J2SE".[17] This version was developed under JSR 176.

J2SE 5.0 entered its end-of-public-updates period on April 8, 2008; updates are no longer available to the public as of November 3, 2009. Updates were available to paid Oracle customers until May 2015.[18]

Tiger added a number of significant new language features:[19][20]

  • Generics: provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion) (specified by JSR 14)
  • Metadata: also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities (specified by JSR 175)
  • Autoboxing/unboxing: automatic conversions between primitive types (such as int) and primitive wrapper classes (such as Integer) (specified by JSR 201)
  • Enumerations: the enum keyword creates a typesafe, ordered list of values (such as Day.MONDAYDay.TUESDAY, etc.); previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern) (specified by JSR 201)
  • Varargs: the last parameter of a method can now be declared using a type name followed by three dots (e.g. void drawtext(String... lines)); in the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type
  • Enhanced for each loop: the for loop syntax is extended with special syntax for iterating over each member of either an array or any Iterable, such as the standard Collection classes (specified by JSR 201)
  • Improved semantics of execution for multi-threaded Java programs; the new Java memory model addresses issues of complexity, effectiveness, and performance of previous specifications[21]
  • Static imports

There were also the following improvements to the standard libraries:

Java 5 is the last release of Java to officially support the Microsoft Windows 98 and Windows ME,[23] while Windows Vista is the newest version of Windows that J2SE 5 was supported on prior to Java 5 going end of life in October 2009.[16]

Java 5 Update 5 (1.5.0_05) is the last release of Java to work on Windows 95 (with Internet Explorer 5.5 installed) and Windows NT 4.0.[24]

Java 5 was first available on Apple Mac OS X 10.4 (Tiger)[25] and was the default version of Java installed on Apple Mac OS X 10.5 (Leopard).

Public support and security updates for Java 1.5 ended in November 2009. Paid security updates for Oracle customers ended in April 2015.

Versioning change[edit source]

This version introduced a new versioning system for the Java language, although the old versioning system continued to be used for developer libraries:

Both version numbers "1.5.0" and "5.0" are used to identify this release of the Java 2 Platform Standard Edition. Version "5.0" is the product version, while "1.5.0" is the developer version. The number "5.0" is used to better reflect the level of maturity, stability, scalability and security of the J2SE.

This correspondence continued through later releases (Java 6 = JDK 1.6, Java 7 = JDK 1.7, and so on).

Java 5 updates[edit source]

ReleaseRelease dateHighlights
Java SE 52004-10-04Metadata, generic types, autoboxing and auto-unboxing of primitive types, enhanced for loop, enumerated types, static import, formatted I/O, varargs, and concurrency utilities. Improved startup time and memory footprint. Sharing of read-only data between multiple running JVMs. Remote monitoring and management. A new JVM profiling API. Programmatic generation of stack traces. Support for XML 1.1 with Namespaces, XML Schema, SAX 2.0.2, DOM Level 3, and XSLT with a fast XSLTC compiler. Unicode 4.0 support.
Java SE 5 Update 12004-12-2550 bugs have been fixed.
Java SE 5 Update 22005-03-16A few crashes were fixed. The program is now compiled with better optimization. Calendar bugfixes and other bugfixes were made.
Java SE 5 Update 32005-05-03This release fixes several bugs, including crashes of the Linux Mozilla plugin.
Java SE 5 Update 42005-07-04With the release, J2SE support for Windows 64-bit has progressed from release candidate to final release. This version runs on AMD64/EM64T 64-bit mode machines with Windows Server 2003 x64 Editions.
Java SE 5 Update 52005-09-18Several bugs were fixed and performance enhancements were made. Last release for Windows 95 and Windows NT 4.0.
Java SE 5 Update 62005-12-07Prior to this update, an applet or application could specify the version of the JRE on which it would run. This has changed. All applets are executed with the latest JRE version.
Java SE 5 Update 72006-05-29Several bugs were fixed and performance enhancements were made.
Java SE 5 Update 82006-08-13Several bugs were fixed and performance enhancements were made.
Java SE 5 Update 92006-11-12This release fixes several minor regressions.
Java SE 5 Update 102006-12-22An implementation of the epoll I/O event notification facility, supported by Linux 2.6, was added. Many bugs were fixed.
Java SE 5 Update 112007-03-08Several bugs were fixed and performance enhancements were made.
Java SE 5 Update 122007-06-11
Java SE 5 Update 132007-10-05Multiple security vulnerabilities in Java Web Start relating to local file access were fixed. A security vulnerability in the JRE allowing network access restrictions to be circumvented was fixed. Several other security issues and minor bugs were fixed.
Java SE 5 Update 14
Java SE 5 Update 152008-03-06Several crashes due to heap buffer out-of-bounds were fixed, along with several other bugs. New root certificates from AOL, DigiCert, and TrustCenter are now included.
Java SE 5 Update 162008-07-23This release fixes several security flaws, such as DoS vulnerabilities, buffer overflows, and other bugs which could lead to crashes or which would give applets access to certain system resources. These vulnerabilities were located in Java Web Start, in the Java Management Extensions (JMX) Management Agent, and in the functions for handling XML data.
Java SE 5 Update 172008-12-03The UTF-8 charset implementation was updated to handle the non-shortest form of UTF-8 byte sequences, introducing an incompatibility from previous releases. New root certificates were added. Many bugs were fixed.
Java SE 5 Update 182009-03-25Several security issues were resolved. The behavior of the JNDI feature to store and retrieve Java objects in an LDAP directory was slightly modified. Five new root certificates were added. Many bugs were fixed.
Java SE 5 Update 192009-05-29Support was added for several system configurations. Service Tag support was added. Many bugs were fixed, including several crashes and memory leaks.
Java SE 5 Update 202009-08-06Several security vulnerabilities were resolved, such as potential system access by untrusted applets, and integer overflows in image processing and in Unpack200. Several new root certificates were added. Many other minor bugs were fixed.
Java SE 5 Update 212009-09-09Many minor bugs were fixed.
Java SE 5 Update 222009-11-04This release marks the End of Service Life (EOSL) for Java 5, and is its final public version. Several security vulnerabilities, reported as Sun Alerts 269868, 270474, 270475, and 270476, were fixed. Several other bugs were fixed. Furthermore, two new root certificates were added.
Java SE 5 Update 232010-01-13Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 32 security fixes.
Java SE 5 Update 242010-04-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 2 security fixes.
Java SE 5 Update 252010-07-07Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 26 security fixes.
Java SE 5 Update 262010-10-12Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 2 security fixes.
Java SE 5 Update 272010-12-08Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 22 security fixes.
Java SE 5 Update 282011-02-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 22 security fixes[27]
Java SE 5 Update 292011-03-21Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 21 security fixes.
Java SE 5 Update 302011-06-07Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 1 security fix.
Java SE 5 Update 312011-08-16Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 10 security fixes.
Java SE 5 Update 322011-10-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 20 security fixes[28]
Java SE 5 Update 332011-12-12Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 21 security fixes.
Java SE 5 Update 342012-02-14Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 14 security fixes[29]
Java SE 5 Update 352012-04-26Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 5 security fixes.
Java SE 5 Update 362012-06-12Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 14 security fixes[30]
Java SE 5 Update 382012-08-14Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 30 security fixes[31]
Java SE 5 Update 392013-02-19Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 50 security fixes[32]
Java SE 5 Update 402013-02-19Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 5 security fixes[33]
Java SE 5 Update 412013-03-04Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 2 security fixes[34]
Java SE 5 Update 452013-04-16Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 42 security fixes[35]
Java SE 5 Update 512013-06-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 40 security fixes[36]
Java SE 5 Update 552013-10-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 51 security fixes[37]
Java SE 5 Update 612014-01-14Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 36 security fixes[38]
Java SE 5 Update 652014-04-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 37 security fixes[39]
Java SE 5 Update 712014-07-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 20 security fixes[40]
Java SE 5 Update 752014-10-16Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 25 security fixes[41]
Java SE 5 Update 812015-01-21Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 19 security fixes[42]
Java SE 5 Update 852015-04-14Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 14 security fixes[43]

Java SE 6[edit source]

Codename Mustang. As of the version released on December 11, 2006, Sun replaced the name "J2SE" with Java SE and dropped the ".0" from the version number.[44] Internal numbering for developers remains 1.6.0.[45] This version was developed under JSR 270.

During the development phase, new builds including enhancements and bug fixes were released approximately weekly. Beta versions were released in February and June 2006, leading up to a final release that occurred on December 11, 2006.

Major changes included in this version:[46][47]

  • Support for older Win9x versions dropped; unofficially, Java 6 Update 7 was the last release of Java shown to work on these versions of Windows.[citation needed] This is believed[by whom?] to be due to the major changes in Update 10.
  • Scripting Language Support (JSR 223): Generic API for tight integration with scripting languages, and built-in Mozilla JavaScript Rhino integration.
  • Dramatic performance improvements for the core platform,[48][49] and Swing.
  • Improved Web Service support through JAX-WS (JSR 224).
  • JDBC 4.0 support (JSR 221).
  • Java Compiler API (JSR 199): an API allowing a Java program to select and invoke a Java Compiler programmatically.
  • Upgrade of JAXB to version 2.0: Including integration of a StAX parser.
  • Support for pluggable annotations (JSR 269).[50]
  • Many GUI improvements, such as integration of SwingWorker in the API, table sorting and filtering, and true Swing double-buffering (eliminating the gray-area effect).
  • JVM improvements include: synchronization and compiler performance optimizations, new algorithms and upgrades to existing garbage collection algorithms, and application start-up performance.

Java 6 can be installed to Mac OS X 10.5 (Leopard) running on 64-bit (Core 2 Duo and higher) processor machines.[51] Java 6 is also supported by both 32-bit and 64-bit machines running Mac OS X 10.6 (Snow Leopard).

Java 6 reached the end of its supported life in February 2013, at which time all public updates, including security updates, were scheduled to be stopped.[52][53] Oracle released two more updates to Java 6 in March and April 2013, which patched some security vulnerabilities.[54][55]

Java 6 updates[edit source]

After Java 6 release, Sun, and later Oracle, released several updates which, while not changing any public API, enhanced end-user usability or fixed bugs.[56]

ReleaseRelease dateHighlights
Java SE 62006-12-23This release adds many enhancements in the fields of Web services, scripting, databases, pluggable annotations, and security, as well as quality, compatibility, and stability. JConsole is now officially supported. Java DB support has been added.
Java SE 6 Update 12007-05-07
Java SE 6 Update 22007-07-03
Java SE 6 Update 32007-10-03
Java SE 6 Update 42008-01-14HotSpot VM 10
Java SE 6 Update 52008-03-05Several security flaws were eliminated. New root certificates from AOL, DigiCert, and TrustCenter are now included.
Java SE 6 Update 62008-04-16A workaround for the infamous Xlib/XCB locking assertion issue was introduced. A memory leak when using Kerberos authentication with LoginContext was fixed. Several other bugs were fixed.
Java SE 6 Update 7[57]Unofficially, Java SE 6 Update 7 (1.6.0.7) is the last version of Java that was shown to be working on the Win9x family of operating systems[citation needed]
Java SE 6 Update 10[58]2008-10-15HotSpot VM 11. Major changes for this update include:
  • Java Deployment Toolkit, a set of JavaScript functions to ease the deployment of applets and Java Web Start applications.[59]
  • Java Kernel, a small installer including only the most commonly used JRE classes. Other packages are downloaded when needed.
  • Enhanced updater.
  • Enhanced versioning and pack200 support: server-side support is no longer required.[60]
  • Java Quick Starter, to improve cold start-up time.
  • Improved performance of Java2D graphics primitives on Windows, using Direct3D and hardware acceleration.
  • A new Swing look and feel called Nimbus and based on synth.[61]
  • Next-Generation Java Plug-In: applets now run in a separate process and support many features of Web Start applications.[62]
Java SE 6 Update 11[63]2008-12-0313 security fixes[64]
Java SE 6 Update 12[65]2008-12-12No security fixes; 64-bit Java plug-in (for 64-bit web browsers only); Windows Server 2008 support; performance improvements of graphics and JavaFX applications
Java SE 6 Update 13[66]2009-03-247 security fixes, JNDI store and retrieve Java objects in LDAP slightly modified, JMX Change (createMBeanunregisterMBean), 4 new root certificates added
Java SE 6 Update 14[67]2009-05-28HotSpot VM 14. This release includes extensive performance updates to the JIT compiler, compressed pointers for 64-bit machines, as well as support for the G1 (Garbage First) low-pause garbage collector.[68][69]

The -XX:+DoEscapeAnalysis option directs the HotSpot JIT compiler to use escape analysis to determine if local objects can be allocated on the stack instead of the heap.[70]

Some developers have noticed an issue introduced in this release which causes debuggers to miss breakpoints seemingly randomly.[71] Sun has a corresponding bug, which is tracking the issue. The workaround applies to the Client and Server VMs.[72] Using the -XX:+UseParallelGC option will prevent the failure. Another workaround is to roll back to update 13, or to upgrade to update 16.

Java SE 6 Update 152009-08-04Introduced patch-in-place functionality[73]
Java SE 6 Update 162009-08-11Fixed the issue introduced in update 14 which caused debuggers to miss breakpoints[74]
Java SE 6 Update 17[75]2009-11-04Security fixes; two new root certificates
Java SE 6 Update 18[76]2010-01-13No security fixes; Hotspot VM 16; support for Ubuntu 8.04 LTS Desktop Edition, SLES 11, Windows 7Red Hat Enterprise Linux 5.3, Firefox 3.6, VisualVM 1.2; updated Java DB; many performance improvements
Java SE 6 Update 19[77]2010-03-30Security fixes; root certificate changes: seven new, three removed, five replaced with stronger signature algorithms; interim fix for TLS renegotiation attack
Java SE 6 Update 20[78]2010-04-152 security fixes
Java SE 6 Update 21[79]2010-07-07No security fixes; Hotspot VM 17; support for Red Hat Enterprise Linux 5.4 and 5.5, Oracle Enterprise Linux 4.8, 5.4, 5.5; Google Chrome 4 support; support for Customized Loading Progress Indicators; VisualVM 1.2.2
Java SE 6 Update 22[80]2010-10-1229 security fixes; RFC 5746 support
Java SE 6 Update 23[81]2010-12-08No security fixes; Hotspot VM 19; better support for right-to-left languages
Java SE 6 Update 24[82]2011-02-1521 security fixes; updated Java DB
Java SE 6 Update 252011-03-21No security fixes; Hotspot VM 20; support for Internet Explorer 9Firefox 4 and Chrome 10; improved BigDecimal; includes "tiered" compilation in the Server VM that enables it to start quickly as does the Client VM, while achieving better peak performance (this feature is enabled by specifying -server and -XX:+TieredCompilation command options)[83]
Java SE 6 Update 26[84]2011-06-0717 new security fixes;[85] last version compatible with Windows Vista SP1
Java SE 6 Update 27[86]2011-08-16No security fixes; certification for Firefox 5
Java SE 6 Update 29[87]2011-10-1820 security fixes, various bug fixes[88]
Java SE 6 Update 30[89]2011-12-12No security fixes; fix for SSL regression in Update 29; support for Red Hat Enterprise Linux 6
Java SE 6 Update 31[90]2012-02-1414 security fixes and one bug fix; last version work reliably for Windows 2000[91]
JAVA SE 6 Update 32[92]2012-04-26No security fixes, various bug fixes
Java SE 6 Update 33[93]2012-06-1214 security fixes, improved VM configuration file loading
Java SE 6 Update 34[94]2012-08-14No security fixes, various bug fixes
Java SE 6 Update 35[95]2012-08-30Contains a security-in-depth fix[96]
Java SE 6 Update 37[97]2012-10-1630 security fixes
Java SE 6 Update 38[98]2012-12-11Various bug fixes[99]
Java SE 6 Update 39[100]2013-02-0150 security fixes
Java SE 6 Update 41[101]2013-02-195 security fixes
Java SE 6 Update 43[102]2013-03-042 security fixes
Java SE 6 Update 45[103]2013-04-1642 security fixes;[104] other changes;[103] final public update.[105]
Java SE 6 Update 51[106]2013-06-18Not available publicly, only available through the Java SE Support program and in Apple Update for OS X Snow Leopard, Lion & Mountain Lion; up to 40 security fixes[107]
Java SE 6 Update 65[108]2013-10-15Not available publicly, only available through the Java SE Support program and in Apple Update for OS X Snow Leopard, Lion & Mountain Lion; at least 11 critical security fixes[109]
Java SE 6 Update 71[110]2014-01-14Not available for public download; 33 fixes[111]
Java SE 6 Update 75[112]2014-04-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster no. #54; 25 security fixes[113]
Java SE 6 Update 81[114]2014-07-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 11 security fixes[115]
Java SE 6 Update 85[116]2014-10-16Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 18 security fixes[117]
Java SE 6 Update 91[118]2015-01-21Linux x64 and Windows i586 versions are available as the Java SE 6 Reference Implementation.[119] Other versions are only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 15 security fixes[120]
Java SE 6 Update 952015-04-14Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 14 security fixes[121]
Java SE 6 Update 1012015-07-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 18 security fixes[122] Certification for IE 10 and 11 was introduced in 1.6.0_101
Java SE 6 Update 1052015-10-20Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 17 security fixes[123]
Java SE 6 Update 1112016-01-20Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 13 security fixes[124]
Java SE 6 Update 1132016-02-05Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 1 security fix[125]
Java SE 6 Update 1152016-04-21Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 8 security fixes[126]
Java SE 6 Update 1212016-07-19Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 15 security fixes[127]
Java SE 6 Update 1312016-10-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 13 security fixes[128]
Java SE 6 Update 1412017-01-17Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 17 security fixes[129]
Java SE 6 Update 1512017-04-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 10 security fixes[130]
Java SE 6 Update 1612017-07-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 5 security fixes[131]
Java SE 6 Update 1712017-10-20Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 7 security fixes[132]
Java SE 6 Update 1812018-01-16Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 12 security fixes[133]
Java SE 6 Update 1912018-04-17Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 7 security fixes[134]
Java SE 6 Update 2012018-07-17Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 3 security fixes[135]

Java SE 7[edit source]

Java 7 (codename Dolphin[136]) is a major update that was launched on July 7, 2011[137] and was made available for developers on July 28, 2011.[138] The development period was organized into thirteen milestones; on June 6, 2011, the last of the thirteen milestones was finished.[139][140] On average, 8 builds (which generally included enhancements and bug fixes) were released per milestone. The feature list at the OpenJDK 7 project lists many of the changes.

Additions in Java 7 include:[141]

  • Strings in switch[146]
  • Automatic resource management in try-statement[147]
  • Improved type inference for generic instance creation, aka the diamond operator <>[148]
  • Simplified varargs method declaration[149]
  • Binary integer literals[150]
  • Allowing underscores in numeric literals[151]
  • Catching multiple exception types and rethrowing exceptions with improved type checking[152]
  • Concurrency utilities under JSR 166[153]
  • New file I/O library (defined by JSR 203) adding support for multiple file systems, file metadata and symbolic links. The new packages are java.nio.filejava.nio.file.attribute and java.nio.file.spi[154][155]
  • Timsort is used to sort collections and arrays of objects instead of merge sort
  • Library-level support for elliptic curve cryptography algorithms
  • An XRender pipeline for Java 2D, which improves handling of features specific to modern GPUs
  • New platform APIs for the graphics features originally implemented in version 6u10 as unsupported APIs[156]
  • Enhanced library-level support for new network protocols, including SCTP and Sockets Direct Protocol
  • Upstream updates to XML and Unicode
  • Java Deployment Rulesets[157]

Lambda (Java's implementation of lambda functions), Jigsaw (Java's implementation of modules), and part of Coin were dropped from Java 7, and released as part of Java 8 (except for Jigsaw, which will be in Java 9).[158][159]

Java 7 was the default version to download on java.com from April 2012 until Java 8 was released.[160]

Java 7 updates[edit source]

Oracle issued public updates to the Java 7 family on a quarterly basis[161] until April 2015 when the product reached the end of its support lifecycle.[162][163]

ReleaseRelease dateHighlights
Java SE 7[164]2011-07-28Initial release; HotSpot VM 21
Java SE 7 Update 1[165]2011-10-1820 security fixes, other bug fixes
Java SE 7 Update 2[166]2011-12-12No security fixes; HotSpot VM 22; reliability and performance improvements; support for Solaris 11 and Firefox 5 and later; JavaFX included with Java SE JDK, improvements for web-deployed applications
Java SE 7 Update 3[167]2012-02-1414 security fixes[168]
Java SE 7 Update 4[169]2012-04-26No security updates; HotSpot VM 23; JDK Support for Mac OS X
Java SE 7 Update 5[170]2012-06-1214 security fixes[171]
Java SE 7 Update 6[172]2012-08-14JavaFX and Java Access Bridge included in Java SE JDK and JRE installation, JavaFX support for touch-enabled monitors and touch pads, JavaFX support for Linux, JDK and JRE Support for Mac OS X, JDK for Linux on ARM[173]
Java SE 7 Update 7[174]2012-08-304 security fixes[96]
Java SE 7 Update 9[175]2012-10-1630 security vulnerabilities fixes[176]
Java SE 7 Update 10[177]2012-12-11New security features, such as the ability to disable any Java application from running in the browser and new dialogs to warn you when the JRE is insecure, and bug fixes
Java SE 7 Update 11[178]2013-01-13Olson Data 2012i; bugfix for problems with registration of plugin on systems with Stand-alone version of JavaFX Installed, security fixes for CVE-2013-0422;[179] the default security level for Java applets and web start applications has been increased from "Medium" to "High"
Java SE 7 Update 13[180]2013-02-0150 security fixes
Java SE 7 Update 15[181]2013-02-195 security fixes
Java SE 7 Update 17[182]2013-03-042 security fixes
Java SE 7 Update 21[183]2013-04-16Multiple changes including 42 security fixes, a new Server JRE that doesn't include the plug-in, and the JDK for Linux on ARM
Java SE 7 Update 25[184]2013-06-18Multiple changes including 40 security fixes[107][185]
Java SE 7 Update 40[186]2013-09-10621 bug fixes,[187] New security features, hardfloat ARM, Java Mission Control 5.2 and Retina Display support[188]
Java SE 7 Update 45[189]2013-10-1551 security fixes;[190] protections against unauthorized redistribution of Java applications; restore security prompts; JAXP changes; TimeZone.setDefault change
Java SE 7 Update 51[191]2014-01-1436 security fixes; block JAVA applets without manifest (like Remote console – Java Applet – IBM IMM card, HP iLO card) even if warning dialog is with sentence "will be blocked in next version",[192][193] 17 bug fixes
Java SE 7 Update 55[194]2014-04-1537 security fixes,[195] 19 bug fixes[196]
Java SE 7 Update 60[197]2014-05-28Java Mission Control 5.3,[198] 130 bug fixes[199]
Java SE 7 Update 65[200]2014-07-1518 bug fixes[201]
Java SE 7 Update 67[202]2014-08-041 bug fix[203]
Java SE 7 Update 71[204]2014-10-1416 bug fixes[205]
Java SE 7 Update 72[206]2014-10-14Same release date with Update 71 as a corresponding Patch Set Update (PSU) for Java SE 7,[207] 36 bug fixes[208]
Java SE 7 Update 75[209]2015-01-2012 bug fixes,[210] SSLv3 disabled by default
Java SE 7 Update 76[211]2015-01-20Same release date with Update 75 as a corresponding Patch Set Update (PSU) for Java SE 7,[207] 97 bug fixes[212]
Java SE 7 Update 79[213]2015-04-1421 security fixes, 6 bug fixes,[214]
Java SE 7 Update 80[215]2015-04-14Last public release of Java 7; same release date with Update 79 as a corresponding Patch Set Update (PSU) for Java SE 7, 104 bug fixes[216]
Java SE 7 Update 852015-07-15Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 25 security fixes[217]
Java SE 7 Update 912015-10-20Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 20 security fixes[218]
Java SE 7 Update 952016-01-19Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 8 security fixes[219]
Java SE 7 Update 972016-02-05Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 1 security fix[220]
Java SE 7 Update 992016-03-23Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 1 security fix[221]
Java SE 7 Update 1012016-04-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 22 security fixes[222]
Java SE 7 Update 1112016-07-19Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 36 security fixes[223]
Java SE 7 Update 1212016-10-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 32 security fixes[224]
Java SE 7 Update 1312017-01-17Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 34 security fixes[225]
Java SE 7 Update 1412017-04-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 8 security fixes[226]
Java SE 7 Update 1512017-07-18Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 4 security fixes[227]
Java SE 7 Update 1612017-10-20Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 4 security fixes[228]
Java SE 7 Update 1712018-01-16Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 51 security fixes[229]
Java SE 7 Update 1812018-04-17Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 12 security fixes[230]
Java SE 7 Update 1912018-07-17Not available publicly, only available through the Java SE Support program and in Solaris 10's Recommended Patchset Cluster; 9 security fixes[231]

Java SE 8[edit source]

Java 8 (codename: Spider) was released on March 18, 2014,[232][233] and included some features that were planned for Java 7 but later deferred.[234]

Work on features was organized in terms of JDK Enhancement Proposals (JEPs).[235]

  • JSR 335, JEP 126: Language-level support for lambda expressions (officially, lambda expressions; unofficially, closures) under Project Lambda[236] and default methods (virtual extension methods)[237][238][239] which allow the addition of methods to interfaces without breaking existing implementations. There was an ongoing debate in the Java community on whether to add support for lambda expressions.[240][241] Sun later declared that lambda expressions would be included in Java and asked for community input to refine the feature.[242] Supporting lambda expressions also enables functional-style operations on streams of elements, such as MapReduce-inspired transformations on collections. Default methods allow an author of an API to add new methods to an interface without breaking the old code using it. Although it was not their primary intent,[237] default methods also allow multiple inheritance of behavior (but not state).
  • JSR 223, JEP 174: Project Nashorn, a JavaScript runtime which allows developers to embed JavaScript code within applications
  • JSR 308, JEP 104: Annotation on Java Types[243]
  • Unsigned Integer Arithmetic[244]
  • JSR 337, JEP 120: Repeating annotations[245]
  • JSR 310, JEP 150: Date and Time API[246]
  • JEP 178: Statically-linked JNI libraries[247]
  • JEP 153: Launch JavaFX applications (direct launching of JavaFX application JARs)[248]
  • JEP 122: Remove the permanent generation[249]

Java 8 is not supported on Windows XP[250] but as of JDK 8 update 25, it can still be installed and run under Windows XP.[251] Previous updates of JDK 8 could be run under XP, but had to be installed after a forced installation by directly unzipping files from the installation executable.

From October 2014, Java 8 was the default version to download (and then again the download replacing Java 9) from the official website.[252] "Oracle will not post further updates of Java SE 8 to its public download sites for commercial use after January 2019".[3]

Java 8 updates[edit source]

ReleaseRelease dateHighlights
Java SE 82014-03-18Initial release
Java SE 8 Update 5[253]2014-04-15Using "*" in Caller-Allowable-Codebase attribute; 11 bug fixes
Java SE 8 Update 11[254]2014-07-15Java Dependency Analysis Tool (jdeps); Java Control Panel option to disable sponsors; JAR file attribute – Entry-Point; JAXP processing limit property – maxElementDepth; 18 security bug fixes,[255] 15 bug fixes
Java SE 8 Update 20[256]2014-08-19669 bug fixes,[257] JMC 5.4, String deduplication (disabled by default)
Java SE 8 Update 25[258]2014-10-1410 bug fixes
Java SE 8 Update 31[259]2015-01-1926 bug fixes; SSLv3 (disabled by default)
Java SE 8 Update 40[260]2015-03-03645 bug fixes,[261] Added the notion of "memory pressure" to help indicate how much of system's memory is still available (low pressure = high memory, high pressure = low memory)
Java SE 8 Update 45[262]2015-04-1413 bug fixes
Java SE 8 Update 51[263]2015-07-14Added support for native sandbox on Windows platforms (disabled by default); also, 25 security fixes, 14 bug fixes
Java SE 8 Update 60[264]2015-08-18480 bug fixes[265]
Java SE 8 Update 65[266]2015-10-2025 security fixes, 3 bug fixes
Java SE 8 Update 66[267]2015-11-1615 bug fixes
Java SE 8 Update 71[268]2016-01-198 security fixes, 5 bug fixes[269]
Java SE 8 Update 722016-01-198 security fixes, 5 bug fixes, several enhancements
Java SE 8 Update 73[270]2016-02-031 security fix
Java SE 8 Update 74[271]2016-02-031 security fix
Java SE 8 Update 77[272]2016-03-231 security fix
Java SE 8 Update 91[273]2016-04-199 security fixes, 4 bug fixes and enhancements
Java SE 8 Update 92[274]2016-04-19Security and bug fixes from 8u91, plus 76 additional bug fixes; the ExitOnOutOfMemoryError and CrashOnOutOfMemoryError flags have been introduced
Java SE 8 Update 101[275]2016-07-19Security and bug fixes from 8u92, plus 9 additional bug fixes
Java SE 8 Update 102[276]2016-07-19Security and bug fixes from 8u101, plus 118 additional bug fixes
Java SE 8 Update 111[277]2016-10-187 Security fixes and 9 bug fixes
Java SE 8 Update 112[278]2016-10-18Additional features and 139 bug fixes over 8u111
Java SE 8 Update 121[279]2017-01-173 additional features, 5 changes, and 11 bug fixes over 8u112.
Java SE 8 Update 131[280]2017-04-184 changes and 42 bug fixes (2 notable).
Java SE 8 Update 141[281]2017-07-18Additional feature, 3 changes and 12 bug fixes.
Java SE 8 Update 144[282]2017-07-2632 Security fixes and bug fixes from 8u141.
Java SE 8 Update 151[283]2017-10-1722 Security fixes, 2 notes, 1 certificate revocation, 1 new feature, 6 changes and 24 bug fixes from 8u144.
Java SE 8 Update 152[284]2017-10-17Security fixes, 1 new feature, 1 change and 238 bug fixes from 8u151 (1 notable).
Java SE 8 Update 161[285]2018-01-1621 Security fixes, 3 new features, 9 changes and 1 bug fix from 8u152.
Java SE 8 Update 162[286]2018-01-16Security fixes, 63 bug fixes.
Java SE 8 Update 171[287]2018-04-17Security fixes, bug fixes.
Java SE 8 Update 172[288]2018-04-17Security fixes, bug fixes.
Java SE 8 Update 181[289]2018-07-17Security fixes, bug fixes.

Java SE 9[edit source]

At JavaOne 2011, Oracle discussed features they hoped to release for Java 9 in 2016.[290] Java 9 should include better support for multi-gigabyte heaps, better native code integration, a different default garbage collector (G1, for "shorter response times")[291] and a self-tuning JVM.[292] In early 2016, the release of Java 9 was rescheduled for March 2017,[293] later again postponed four more months to July 2017,[294] and changed again to be finally available on September 21, 2017,[295] due to controversial acceptance of the current implementation of Project Jigsaw by Java Executive Committee,[296] which led Oracle to fix some open issues and concerns, and to refine some critical technical questions. In the last days of June 2017, Java Community Process expressed nearly unanimous consensus on the proposed Module System scheme.[297]

  • JSR 376: Modularization of the JDK under Project Jigsaw (Java Platform Module System)[159]
  • JEP 222: jshell: The Java Shell (a Java REPL)[298]
  • JEP 295: Ahead-of-Time Compilation[299]
  • JEP 268: XML Catalogs[300]
  • JEP 266: More Concurrency Updates.[301] It includes a Java implementation of Reactive Streams,[302] including a new Flow class[303] that will include the interfaces currently provided by Reactive Streams.[304]
  • JEP 193: Variable Handles:[305] Define a standard means to invoke the equivalents of various java.util.concurrent.atomic and sun.misc.Unsafe operations
  • JEP 282: jlink: The Java Linker:[306] Create a tool that can assemble and optimize a set of modules and their dependencies into a custom run-time image. It effectively allows to produce a fully usable executable including the JVM to run it.
  • JavaDB was removed from JDK[307]
  • JEP 263: HiDPI Graphics: Automatic scaling and sizing[308]

The first Java 9 release candidate was released on August 9, 2017.[309] The first stable release of Java 9 was on September 21, 2017.[310]

Java 9 updates[edit source]

ReleaseRelease dateHighlights
Java SE 9[311]2017-09-21Initial release
Java SE 9.0.1[312]2017-10-17October 2017 security fixes and critical bug fixes
Java SE 9.0.4[313]2018-01-16Final release for JDK 9; January 2018 security fixes and critical bug fixes

Java SE 10[edit source]

OpenJDK 10 was released on 20 March 2018, with twelve new features confirmed.[314] Among these features were:

  • JEP 286: Local-Variable Type Inference[315]
  • JEP 317: Experimental Java-Based JIT Compiler[316] This is the integration of the Graal dynamic compiler for the Linux x64 platform
  • JEP 310: Application Class-Data Sharing[317] This allows application classes to be placed in the shared archive to reduce startup and footprint for Java applications
  • JEP 322: Time-Based Release Versioning[318]
  • JEP 307: Parallel Full GC for G1[319]
  • JEP 304: Garbage-Collector Interface[320]
  • JEP 314: Additional Unicode Language-Tag Extensions[321]
  • JEP 319: Root Certificates[322]
  • JEP 312: Thread-Local Handshakes[323]
  • JEP 316: Heap Allocation on Alternative Memory Devices[324]
  • JEP 313: Remove the Native-Header Generation Tool – javah[325]
  • JEP 296: Consolidate the JDK Forest into a Single Repository[326]

Java 10 updates[edit source]

ReleaseRelease dateHighlights
Java SE 10[327]2018-03-20Initial release
Java SE 10.0.1[328]2018-04-17Security fixes, 5 bug fixes[329]
Java SE 10.0.22018-07-17

Java SE 11[edit source]

JDK 11 will be released on September 25, 2018[330] and the version is currently open for bug fixes. Java 11 will include a number of new features, such as Dynamic Class-File Constants,[331] Epsilon: A No-Op Garbage Collector,[332] Local-Variable Syntax for Lambda Parameters,[333] and Low-Overhead Heap Profiling,[334] among other features.[335]

Possible future features[edit source]

There is speculation of introducing objects without identity (value types),[336][337] as well as moving towards 64-bit addressable arrays to support large data sets.[338]

Implementations[edit source]

The officially supported Java platform, first developed at Sun and now stewarded by Oracle, is Java SE. Releases are based on the OpenJDK project, which is a free and open source project with an open development model. Other Java implementations exist, however—in part due to Java's early history as proprietary software, while some implementations were created to offer some benefits over the standard implementation, often the result of some area of academic or corporate-sponsored research. Many GNU/Linux distributions include builds of OpenJDK through the IcedTea project started by Red Hat, which provides an easier build and integration environment.

Visual J++ and the Microsoft Java Virtual Machine were created as incompatible implementations. After the Sun v. Microsoft lawsuit, Microsoft abandoned it and began work on the .NET platform.

Other proprietary Java implementations are available, such as the work from Azul.

Prior to the release of OpenJDK, while Sun's implementation was still proprietary, the GNU Classpath project was created to provide a free and open source implementation of the Java platform. Since the release of JDK 7, when OpenJDK became the official reference implementation, the original motivation for the GNU Classpath project almost completely disappeared and its last release was in 2012.

The Apache Harmony project was started shortly before the release of OpenJDK. After Sun's initial source code release, the Harmony project continued, working to provide an implementation under a permissive license, in contrast to the copyleft license chosen for OpenJDK. Google later developed Android and released it under a permissive license. Android incorporated parts of the Harmony project, supplemented with Google's own Dalvik virtual machine and ART. Apache Harmony has since been retired, and Google has switched its use of Harmony components with equivalent ones from OpenJDK.

Both Jikes and Jikes RVM are open source research projects that were developed by IBM.

Several other implementations exist that started as proprietary software but are now open source. IBM initially developed OpenJ9 as the proprietary J9,[341] but has since relicensed the project and donated it to the Eclipse FoundationJRockit is a proprietary implementation that was acquired by Oracle and incorporated into subsequent OpenJDK versions.


source - https://en.wikipedia.org/wiki/Java_version_history




'Development > Java' 카테고리의 다른 글

Java 8 - Memory Management  (0) 2018.09.16
Java - version history  (0) 2018.09.16
Java - Underscores in Numeric Literals  (0) 2018.08.11
java - Xms Xmx  (0) 2018.07.23
Java - Executor vs Thread  (0) 2018.07.20
Java 8 Date  (0) 2018.07.01
Posted by linuxism




source - https://unix.stackexchange.com/questions/31407/how-does-forking-affect-a-processs-memory-layout,

https://manybutfinite.com/post/anatomy-of-a-program-in-memory/



Stack vs Heap

So far we have seen how to declare basic type variables such as intdouble, etc, and complex types such as arrays and structs. The way we have been declaring them so far, with a syntax that is like other languages such as MATLAB, Python, etc, puts these variables on the stack in C.

The Stack

What is the stack? It's a special region of your computer's memory that stores temporary variables created by each function (including the main() function). The stack is a "LIFO" (last in, first out) data structure, that is managed and optimized by the CPU quite closely. Every time a function declares a new variable, it is "pushed" onto the stack. Then every time a function exits, all of the variables pushed onto the stack by that function, are freed (that is to say, they are deleted). Once a stack variable is freed, that region of memory becomes available for other stack variables.

The advantage of using the stack to store variables, is that memory is managed for you. You don't have to allocate memory by hand, or free it once you don't need it any more. What's more, because the CPU organizes stack memory so efficiently, reading from and writing to stack variables is very fast.

A key to understanding the stack is the notion that when a function exits, all of its variables are popped off of the stack (and hence lost forever). Thus stack variables are local in nature. This is related to a concept we saw earlier known as variable scope, or local vs global variables. A common bug in C programming is attempting to access a variable that was created on the stack inside some function, from a place in your program outside of that function (i.e. after that function has exited).

Another feature of the stack to keep in mind, is that there is a limit (varies with OS) on the size of variables that can be stored on the stack. This is not the case for variables allocated on the heap.

To summarize the stack:

  • the stack grows and shrinks as functions push and pop local variables
  • there is no need to manage the memory yourself, variables are allocated and freed automatically
  • the stack has size limits
  • stack variables only exist while the function that created them, is running

The Heap

The heap is a region of your computer's memory that is not managed automatically for you, and is not as tightly managed by the CPU. It is a more free-floating region of memory (and is larger). To allocate memory on the heap, you must use malloc() or calloc(), which are built-in C functions. Once you have allocated memory on the heap, you are responsible for using free() to deallocate that memory once you don't need it any more. If you fail to do this, your program will have what is known as a memory leak. That is, memory on the heap will still be set aside (and won't be available to other processes). As we will see in the debugging section, there is a tool called valgrind that can help you detect memory leaks.

Unlike the stack, the heap does not have size restrictions on variable size (apart from the obvious physical limitations of your computer). Heap memory is slightly slower to be read from and written to, because one has to use pointers to access memory on the heap. We will talk about pointers shortly.

Unlike the stack, variables created on the heap are accessible by any function, anywhere in your program. Heap variables are essentially global in scope.

Stack vs Heap Pros and Cons

Stack

  • very fast access
  • don't have to explicitly de-allocate variables
  • space is managed efficiently by CPU, memory will not become fragmented
  • local variables only
  • limit on stack size (OS-dependent)
  • variables cannot be resized

Heap

  • variables can be accessed globally
  • no limit on memory size
  • (relatively) slower access
  • no guaranteed efficient use of space, memory may become fragmented over time as blocks of memory are allocated, then freed
  • you must manage memory (you're in charge of allocating and freeing variables)
  • variables can be resized using realloc()

Examples

Here is a short program that creates its variables on the stack. It looks like the other programs we have seen so far.

#include <stdio.h>

double multiplyByTwo (double input) {
  double twice = input * 2.0;
  return twice;
}

int main (int argc, char *argv[])
{
  int age = 30;
  double salary = 12345.67;
  double myList[3] = {1.2, 2.3, 3.4};

  printf("double your salary is %.3f\n", multiplyByTwo(salary));

  return 0;
}
double your salary is 24691.340

On lines 10, 11 and 12 we declare variables: an int, a double, and an array of three doubles. These three variables are pushed onto the stack as soon as the main() function allocates them. When the main() function exits (and the program stops) these variables are popped off of the stack. Similarly, in the function multiplyByTwo(), the twice variable, which is a double, is pushed onto the stack as soon as the multiplyByTwo() function allocates it. As soon as the multiplyByTwo() function exits, the twicevariable is popped off of the stack, and is gone forever.

As a side note, there is a way to tell C to keep a stack variable around, even after its creator function exits, and that is to use the static keyword when declaring the variable. A variable declared with the static keyword thus becomes something like a global variable, but one that is only visible inside the function that created it. It's a strange construction, one that you probably won't need except under very specific circumstances.

Here is another version of this program that allocates all of its variables on the heap instead of the stack:

#include <stdio.h>
#include <stdlib.h>

double *multiplyByTwo (double *input) {
  double *twice = malloc(sizeof(double));
  *twice = *input * 2.0;
  return twice;
}

int main (int argc, char *argv[])
{
  int *age = malloc(sizeof(int));
  *age = 30;
  double *salary = malloc(sizeof(double));
  *salary = 12345.67;
  double *myList = malloc(3 * sizeof(double));
  myList[0] = 1.2;
  myList[1] = 2.3;
  myList[2] = 3.4;

  double *twiceSalary = multiplyByTwo(salary);

  printf("double your salary is %.3f\n", *twiceSalary);

  free(age);
  free(salary);
  free(myList);
  free(twiceSalary);

  return 0;
}

As you can see, using malloc() to allocate memory on the heap and then using free() to deallocate it, is no big deal, but is a bit cumbersome. The other thing to notice is that there are a bunch of star symbols * all over the place now. What are those? The answer is, they are pointers. The malloc() (and calloc() and free()) functions deal with pointers not actual values. We will talk more about pointers shortly. The bottom line though: pointers are a special data type in C that store addresses in memory instead of storing actual values. Thus on line 5 above, the twice variable is not a double, but is a pointer to a double. It's an address in memory where the double is stored.

When to use the Heap?

When should you use the heap, and when should you use the stack? If you need to allocate a large block of memory (e.g. a large array, or a big struct), and you need to keep that variable around a long time (like a global), then you should allocate it on the heap. If you are dealing with realtively small variables that only need to persist as long as the function using them is alive, then you should use the stack, it's easier and faster. If you need variables like arrays and structs that can change size dynamically (e.g. arrays that can grow or shrink as needed) then you will likely need to allocate them on the heap, and use dynamic memory allocation functions like malloc()calloc()realloc() and free() to manage that memory "by hand". We will talk about dynamically allocated data structures after we talk about pointers.


source - https://www.gribblelab.org/CBootCamp/7_Memory_Stack_vs_Heap.html






Stack:

  • Stored in computer RAM just like the heap.
  • Variables created on the stack will go out of scope and are automatically deallocated.
  • Much faster to allocate in comparison to variables on the heap.
  • Implemented with an actual stack data structure.
  • Stores local data, return addresses, used for parameter passing.
  • Can have a stack overflow when too much of the stack is used (mostly from infinite or too deep recursion, very large allocations).
  • Data created on the stack can be used without pointers.
  • You would use the stack if you know exactly how much data you need to allocate before compile time and it is not too big.
  • Usually has a maximum size already determined when your program starts.

Heap:

  • Stored in computer RAM just like the stack.
  • In C++, variables on the heap must be destroyed manually and never fall out of scope. The data is freed with deletedelete[], or free.
  • Slower to allocate in comparison to variables on the stack.
  • Used on demand to allocate a block of data for use by the program.
  • Can have fragmentation when there are a lot of allocations and deallocations.
  • In C++ or C, data created on the heap will be pointed to by pointers and allocated with new or malloc respectively.
  • Can have allocation failures if too big of a buffer is requested to be allocated.
  • You would use the heap if you don't know exactly how much data you will need at run time or if you need to allocate a lot of data.
  • Responsible for memory leaks.

Example:

int foo()
{
  char *pBuffer; //<--nothing allocated yet (excluding the pointer itself, which is allocated here on the stack).
  bool b = true; // Allocated on the stack.
  if(b)
  {
    //Create 500 bytes on the stack
    char buffer[500];

    //Create 500 bytes on the heap
    pBuffer = new char[500];

   }//<-- buffer is deallocated here, pBuffer is not
}//<--- oops there's a memory leak, I should have called delete[] pBuffer;



source - https://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap







'Development > C' 카테고리의 다른 글

c - stack and heap  (0) 2018.09.15
c - The null character '\0' and the newline character '\n'  (0) 2016.10.22
c - return vs exit  (0) 2016.03.16
c - Adding Include paths and symbols in Managed Build System for CDT  (0) 2016.02.17
c - waitpid() 함수  (0) 2013.11.03
c - execlp() 함수  (0) 2013.11.03
Posted by linuxism
TAG Memory