piegames
piegames

Reputation: 1121

How do program specific local Java installations affect performance?

When installing Minecraft, it installs a local installation of Java. When running Minecraft, it uses that installation. I see the advantages about updating and multiple Java versions, but it does this regardless of any actual Java installations on my PC. My Java version is always up to date.

I usually have a bunch of Java programs open and always running in background. How does starting a VM from a separate installation affect performance? What are pros and cons of such an installation method? (Although I know most of the pros from Mojang). What if many other programs did this? (Let's say Eclipse for each installation)

Upvotes: 1

Views: 127

Answers (1)

Frelling
Frelling

Reputation: 3507

How does starting a VM from a separate installation affect performance?

In general, it does not. Java applications (Minecraft, Open Office, LibreOffice, Eclipse, etc.) launched from the desktop run in distinct processes by virtue that each Java Virtual Machine (JVM) executing such applications are separate processes. However, it is also possible to run multiple applications in the same JVM; although it is unlikely in a normal desktop environment.

Without additional configurations, a Java application will run on a JVM from your default JRE or JDK installation. In the case of Minecraft, it will run in the JVM from the JRE installed with the new launcher, unless specifically changed in Launch Options using Advanced Settings. Eclipse will run in the default JVM unless configured differently in eclipse.ini.

What are the pros and cons of such an installation method?

In regards to Minecraft, the upside of a separate JRE installation are: 1) it ensures that a suitable JRE is available to run Minecraft; 2) eliminates potential problems dues to older or newer JRE versions; it is a game after all; and, 3) a different version can be installed without requiring changes to the user’s default JRE/JDK. There is no downside for Minecraft.

In regards to other use cases, the pros and cons can be as varied as the number of JREs installed. Case in point, we use current versions of Java 1.6, 1.7, 1.8, and even 1.9 for continuous integration and testing of various libraries and applications. The upside is that we can easily test a variety of environments. The downside is that it can become a configuration nightmare if one is not careful. For example, packaging a Java app under 1.8 and running its integration tests under 1.7. Fortunately, we keep an ample supply of aspirin around.

Upvotes: 2

Related Questions