In this video Charlie Hunt explains the history and implementation of this new feature. The video is not actually about Compact Strings. Compact Strings are only introduced as a case study to explain how with a lot of work, the three legged stool of, latency, throughput and memory footprint can all be improved together.
If you have the time I definitely recommend watching the whole video - although the actual part on Compact Strings start at 26:24.
If you want a 5 minute overview here are the highlights:
- String density (JEP 254 Compact Strings) is a feature of JDK 9.
- Aims were to reduce memory footprint without affecting any performance - latency or throughput as well maintaining full backward compatibility.
- JDK 6 introduced compressed strings but this was never brought forward into later JVMs. This is a complete rewrite.
- To work out how much memory could be saved 960 disparate java application heap dumps were analysed.
- Live data size of the heap dumps were between 300MB and 2.5GB.
- char[] consumed between 10% and 45% of the live data
- vast majority of chars were only one byte in size (i.e. ASCII)
- 75% of the char arrays were 35 chars or smaller
- On average reduction in application size would be 5-15% (reduction in char[] size about 35-45% because of header size)
- The way it will be implemented is that if all chars in the String use only 1 byte (the higher byte is 0) then a byte[] will be used rather than char[] (IS0-8859-1/Latin1 encoding). There will a leading bye to indicate which encoding was used.
- UTF8 not used because it supports variable length chars and is therefore not performant for random access.
- private final byte coder on the String indicates the encoding. Note the room to support many more encodings in the future.
- For all 64 bit JVMs no extra memory was needed for the extra field because of the 'dead' space needed for 8 byte object alignment.
- Throughput doesn't suffer as tested with 400 JMH benchmarks available online.
- The reason for this is that String is highly optimized in that there 55 specific JVM features for String alone.
- Latency also improved tested with industry benchmark SPECjbb2015 also regression tested on SPECjbb2005
- Feature can be enabled and disabled with -XX:+CompactStrings but will be enabled by default.
ReplyDeleteI agree with your thoughts!!! As the demand of java programming application keeps on increasing, there is massive demand for java professionals in software development industries. Thus, taking training will assist students to be skilled java developers in leading MNCs.
Java Training in Chennai
It is useful information, this Compact string type will give more performance like python provided.
ReplyDeleteJava Training in Chennai | JEE Training in Chennai | Spring Training in Chennai
The information you have posted is very useful. The sites you have referred was good. Thanks for sharing... UP Ration Card Status
ReplyDeleteThis information is impressive; I am inspired with your post writing style & how continuously you describe this jdk9 concept. Thanks for sharing.. HP LR Training in Chennai | ALM Training in Chennai | UFT Training in Chennai
ReplyDeleteIt is useful information, this Compact string type will give more performance like python provided. Executive Protection
ReplyDeleteYou can also buy cheap reseller hosting in Pakistan from us. Softhof providing low cost web hosting in Pakistan, both cheap and reliable domain registration and webhosting services to our many satisfied customers. Softhof is one of the famous and oldest web hosting providers. Softhof offers best web hosting services in Lahore Pakistan, you can buy free domain with web hosting services from us.
ReplyDeleteWeb Hosting in Pakistan
Thank you so much for such valuable information sharing. It’s highly appreciated.
ReplyDeleteMicrosoft Azure Admin Training in Chennai
Microsoft Azure Admin Training
Today, encouraged by this post I decided to give a try to Java 10 on the software my company is working on. Roughly speaking, it's an interpreter of exotic programming languages that is not particularly optimized and contains a lot of strings inside.
ReplyDeleteSurprisingly, Java 10 turned out to be A LOT slower than Java 1.8_171, and also eats a lot of memory. On hardest test, it eats 15% more total memory and is 19% slower!
Testing was done on Linux subsystem for Win 10, benchmarking performed with `/usr/bin/time -v `.
Why so?
P.S. hardest test runs continuously with 100% CPU usage on one thread for 20 min.
DeleteExcellent blog about java. Continue sharing more like this.
ReplyDeleteSpring Training in Chennai
Spring Training near me
Spring Hibernate Training in Chennai
Hibernate Training in Chennai
Hibernate Training institute in Chennai
Spring Hibernate Training
Struts Training in Chennai
Given article is very helpful and very useful for my admin, and pardon me permission to share articles here hopefully helped :
ReplyDeleteCara menyembuhkan pembengkakan hati
Cara menyembuhkan fibrosis paru
Cara mengobati jantung berdebar
Cara mengobati impetigo
Cara mengobati lambung bocor secara alami
Obat kerumut tradisional
Cara mengobati sinusitis secara alami
Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
ReplyDeleteJava Training in Chennai
Java course in Chennai
Hadoop Training in Chennai
Python Training in Chennai
Java Training in Porur
Java Training in Adyar
Java Training in Tnagar
This is my first visit to your blog, keep writing more content.
ReplyDeleteLoadrunner Training in Chennai
JAVA Training in Chennai
Hadoop Training in Chennai
Selenium Training in Chennai
German Classes in chennai
French Classes in Chennai
french institute in chennai
Thanks for your blog... It is more useful for us...
ReplyDeleteData Science Courses in Bangalore
Data Science Training in Bangalore
Data Science Certification in Bangalore
Tally course in Madurai
Software Testing Course in Coimbatore
Spoken English Class in Coimbatore
Web Designing Course in Coimbatore
Tally Course in Coimbatore
Tally Training Coimbatore
very good post!!! Thanks for sharing with us... It is more useful for us...
ReplyDeleteSEO Training in Coimbatore
seo course in coimbatore
RPA training in bangalore
Selenium Training in Bangalore
Java Training in Madurai
Oracle Training in Coimbatore
PHP Training in Coimbatore
Awesome blog. I would thank the blog admin for sharing this info with us.
ReplyDeleteIELTS Coaching in Mulund
IELTS Training in Mulund West
IELTS Courses in Mulund
IELTS Coaching Centres in Mulund
IELTS Centres in Mulund East
This is really a valuable post... The info shared is helpful and valuable. Thank you for sharing.
ReplyDeleteAviation Academy in Chennai
Air hostess training in Chennai
Airport management courses in Chennai
Ground staff training in Chennai
Medical coding training in Chennai
Fashion designing courses in Chennai
Interior design courses in Chennai
Thanks for posting this. Its really informative.
ReplyDeleteGerman Classes in Chennai
German Training in Chennai
IELTS Coaching in OMR
TOEFL Coaching Centres in Chennai
french classes
pearson vue
German Courses in Chennai
German classes in Anna Nagar
I believe that your blog will surely help the readers who are really in need of this vital piece of information. Waiting for your updates.
ReplyDeleteSpoken English Classes in Chennai
Spoken English in Chennai
IELTS Coaching in Chennai
IELTS Coaching Centre in Chennai
IELTS Classes in Mumbai
IELTS Coaching in Mumbai
English Speaking Classes in Mumbai
English Speaking Course in Mumbai
Really immeasurable information for us... Thank you for presenting such wonderful details.
ReplyDeletePega Training in Chennai
Pega Course
Primavera Training in Chennai
Tableau Training in Chennai
Unix Training in Chennai
Job Openings in Chennai
Placement Training in Chennai
Linux Training in Chennai
JMeter Training in Chennai
Spark Training in Chennai
Pega Training in Anna Nagar
Really a awesome blog for the freshers. Thanks for posting the information.
ReplyDeletebusiness card price in india
online paper bag printing india
desktop rental in chennai
macbook for rent in chennai
online company registration in india
company registration consultants in india