Openj9: Slow Startup on Linux / IntelliJ IDEA Community

Created on 3 May 2020  路  3Comments  路  Source: eclipse/openj9

First of all thank you for creating a great JVM. I am surprised of how little memory it uses and it looks to work great even with a medium sized JavaFX application, meaning that you have good support of JVM from to bottom!

Now to the issue, steps to reproduce:

  • Use Linux64 bit
  • Download IntelliJ IDEA Community Edition (it is a .tar.gz)
  • replace JBR folder with AdoptOpenJDK OpenJ9
  • compare with either JBR or Hotspot

It looks that IntelliJ IDEA CE is very slow on startup (I can notice at least a 30-50% slower startup) from 30 seconds to 40-50 seconds, and this is done even with subsequent startup and after few seconds the IDE is still working delayed. I would assume that it is because OpenJ9 does call more often the GC which has impact on startup/troughput, but the laptop is a quite low-end Pentium (Kaby Lake based, not Atom based) CPU/Linux with 8 GB of memory.

Version of OpenJ9 is 14 (latest I could download as of May 3rd from AdoptOpenJDK site)

Process Memory: 682 MB in steady state
AdoptJDK HotSpot: 936 MB in steady state

perf userRaised

Most helpful comment

Thank you @pshipton , this option makes it also the subsequent starts (the first one is in around 1 minute mark, but I understand it why, as if I got it right, some metadata is stored for subsequent start) again into very quick land (28-30 seconds) which is faster than JBR.

RAM usage is very small: 605 MB (it looks amazingly small! the default JBR/Hotspot is using 50% more RAM 馃悪 )

As for me, it is enough to close this "bug"/"issue". Not sure if it worth fixing, but at least first time the slow down was jarring and I had no clue why.

I think that now I can recommend OpenJ9 with IDEA tools especially as it starts faster and it uses less ram, what could I ask for more?

All 3 comments

Found later that IntelliJ IDEA lets user to set custom JVM flags in VM (under Help -> Edit Custom VM Options).

These flags are the default flags set by the launch script of IntelliJ IDEA, and I discarded the one that sets by default "ConcurrentMarkAndSweepGC" or other flags that I understand that they are JVM specific:

-Xms128m -Xmx980m -ea -XX:CICompilerCount=2 -Dsun.io.useCanonPrefixCache=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djdk.attach.allowAttachSelf=true -Dkotlinx.coroutines.debug=off -Djdk.module.illegalAccess.silent=true -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -Dsun.tools.attach.tmp.only=true
The removed flags were: -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50

So on top of them I added:

  • no other flag: 30-35 seconds (so other flags but the upper ones), 684 RAM.
  • -Xquickstart: start time 20-25 seconds (impressive stuff if you ask me!), it feels faster. Reported process RAM: 634 MB

NB. I rerun with flags put back, and it looks that the time went to 30-35 seconds back - so it is similar with the original JBR (from the original bug report), but I don't know why, yesterday, on the same hardware, it was always launching the IDEA CE visibly slower.

Note by default OpenJ9 ignores command line options starting with -XX: that it doesn't understand.

It may be worth trying the OpenJ9 option -Xshareclasses:name=IntelliJ-IDEA,nonfatal to improve startup performance.

Thank you @pshipton , this option makes it also the subsequent starts (the first one is in around 1 minute mark, but I understand it why, as if I got it right, some metadata is stored for subsequent start) again into very quick land (28-30 seconds) which is faster than JBR.

RAM usage is very small: 605 MB (it looks amazingly small! the default JBR/Hotspot is using 50% more RAM 馃悪 )

As for me, it is enough to close this "bug"/"issue". Not sure if it worth fixing, but at least first time the slow down was jarring and I had no clue why.

I think that now I can recommend OpenJ9 with IDEA tools especially as it starts faster and it uses less ram, what could I ask for more?

Was this page helpful?
0 / 5 - 0 ratings