Ready to dive in Java 10(Valhalla) Part 1 -> List — Generic Specialization

While datatypes such as Integer and Long are currently supported, these ‘boxed’ datatypes require extra allocation & memory overhead.

Generic specialization would look to resolve this, and further extend Java’s popularity for high-performance & financial processing.

According to early proposals, the JVM might instantiate an ArrayList<int> by automatically converting the bytecode of ArrayList<T extends Object>. Bytecodes & method signatures with type T would be replaced with their ‘int’ equivalents.

This mean simple from java 10 you will be able to create List of int to get rid of the problem of the OutOfMemory

Example 

List<int> list=new ArrayList<>();

 

Advertisements