How to reduce Scala (/ Java) startup overhead?

前端 未结 3 1780
我寻月下人不归
我寻月下人不归 2020-12-14 08:15

I\'m pretty ignorant of the Java world (I do mostly C / Python) but Scala looked interesting enough to pull me in. One problem I\'m having with it is the enormous startup ov

3条回答
  •  孤街浪徒
    2020-12-14 09:11

    What sort of computer are you using it on? Obviously there is a JVM startup overhead but this is even greater if the JVM detects you are running on a server-class machine.

    In the J2SE platform version 5.0 a class of machine referred to as a server-class machine has been defined as a machine with:

    • 2 or more physical processors
    • 2 or more Gbytes of physical memory

    You can put the JVM in client mode by using the -client option. The client mode is tuned for fast startup time.

    There is also the move to modularize the JVM (project Jigsaw) which will improve startup times even more - this has started with JDK 1.6.0_10.

提交回复
热议问题