Java Performance: Huge Pages Investigated

Since experience tells us that it is quite rare for one CPU to beat another in a benchmark by a factor 3, we investigated the matter further. The most obvious candidate was Huge Pages, or as everybody besides the Linux community calls it: "Large Pages".

Every modern CPU caches the virtual-to-physical memory mappings in their TLBs. The "normal" size of a page is 4 KB, so with 1536 entries, the Skylake core can only cache about 6 MB per core. Consequently, as DRAM capacity has grown the past 15 years from a few GB to hundreds of GBs, TLB misses have become more and more of a concern. A TLB miss is quite expensive – costing several memory accesses in total – as you need to read out several tables to finally find the physical address.

All modern CPU support larger pages. In the x86-64 (Intel & AMD) a 2 MB large page is the most popular option, while a 1 GB page is also available. Meanwhile a large page on the ThunderX2 is no less than 0.5 GB. Using large pages reduces the number of TLB misses (although the number of entries in the TLB is typically much lower for large pages), and also they reduce the number of memory accesses needed if a TLB miss occurs.

However, it took a while before Linux supported this feature in an easy to handle way. Memory fragmentation, conflicting and hard to configure settings, incompatibilities, and especially very confusing names caused a lot of trouble. In fact, many software vendors still advise server admins to disable large pages. So while it was quickly embraced for benchmarks, the software community as a whole is still hesitant.

To that end, let's see what happens if we enable Transparent Huge Pages and keep the best settings we discussed on the previous page.

SPECJBB 2015-Multi Max-jOPS Huge pages impact

Overall, for Max-jOPs the performance impact is nothing spectaculair; in fact it's a slight regression. The Xeon loses about 1% of its throughput, the ThunderX2 about 5%.

Moving on, let's check out the Critical-jOPS metric, where throughput is measured with a 99 percentile response time constraint.

SPECJBB 2015-Multi Critical-jOPS  Huge pages impact

A massive difference! Instead of taking a massive beating, the Intel setup edges out the ThunderX2. Still, it must be said that performance with 4 KB pages seems to be a major weakness with Intel's architecture.

Java Performance Big Data Benchmarking: Apache Spark
Comments Locked

97 Comments

View All Comments

  • Wilco1 - Wednesday, May 23, 2018 - link

    That's your uninformed opinion... Microsoft has different plans.
  • ZolaIII - Thursday, May 24, 2018 - link

    Windows is DOA anyway. M$ makes more money this day's on Linux then it does on Window's combined. Only thing making it still alive is MS Office but even that will change in couple of years.
  • Wilco1 - Thursday, May 24, 2018 - link

    Calling Windows dead when it ships on 95+% of PCs sold is eh... a little bit premature. Get back to me when 50+% of PCs ship with Linux instead of Windows.
  • ZolaIII - Friday, May 25, 2018 - link

    Get back to me when windows ships with 5% in; servers, embedded, router's, smartphones...
  • jimbo2779 - Thursday, May 24, 2018 - link

    In what way is it making more from Linux?
  • ZolaIII - Friday, May 25, 2018 - link

    https://www.computerworld.com/article/3271085/micr...
    Even your Windows PC, Office and everything else from Microsoft this day's is backed up by a cloud which is Linux based.
  • defaultluser - Wednesday, May 23, 2018 - link

    Page 11 has "Apache Spark and Energy Consumption" in the title, but the page only contains
    Apache Spark results. WHERE IS THE ENERGY CONSUMPTION?

    We need power consumption tests during benchmarks to show if the architecture has better perf/watt than Intel. Otherwise, why did you publish this obviously incomplete article?
  • Ryan Smith - Wednesday, May 23, 2018 - link

    Whoops. Sorry, that was a small section that was moved to page 5.
  • ruthan - Wednesday, May 23, 2018 - link

    Well, where is the most important chart performance per dollar comparison with x86 solution?

    That virtualization support, is some arm specific yes i we need feature and proprietary hell like Lpars.. or its finally support Vmware? - that means virtualization.

    Where is could it run Crysis test?
  • HStewart - Wednesday, May 23, 2018 - link

    VMWare is not currently support - and probably not for a long time - unless they ran in emulation mode and it would slower than Atom

    https://kb.vmware.com/s/article/1003882

Log in

Don't have an account? Sign up now