Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accepted XX:UseSSE values for Java JVM?

Tags:

java

jvm

sse

I'd like to compare performance of an application across multiple SSE versions and have been unable to find the values that are accepted by this JVM flag. I'm testing 0, 1, 3, and 4. I'm most unsure about if 4 is accepted (all examples I've seen are up to 3) and/or if it's variations (4.1-4.3) can be explicitly defined. Does anyone have any further info on this?

like image 940
Infraded Avatar asked Apr 05 '11 02:04

Infraded


People also ask

What are JVM options?

There are three types of options that you can add to your JVM, standard, non-standard and advanced options. If you apply an advanced option, you always precede the option with -XX: . Similarly if you're using a non-standard option, you'll use -X . Standard options don't prepend anything to the option.

What is a JVM argument?

JVM arguments are flags that are passed to the Java Virtual Machine at the time the application is launched. On Linux or Mac machines, they can be provided through the JAVA_OPTS setting in the whd.conf file.

How do I find Java options in Linux?

You can use the ps command to view running Java processes on a system also by piping output to grep . OpenJDK, however, has its very own specific process monitor. The Java Virtual Machine Process Status (jps) tool allows you to scan for each running instance of the Java Virtual Machine (JVM) on your system.


1 Answers

Use the source ;)

http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/39d920531a4d/src/cpu/x86/vm/vm_version_x86.cpp#l464

if (UseSSE < 4) {
  _cpuFeatures &= ~CPU_SSE4_1;
  _cpuFeatures &= ~CPU_SSE4_2;
}

if (UseSSE < 3) {
  _cpuFeatures &= ~CPU_SSE3;
  _cpuFeatures &= ~CPU_SSSE3;
  _cpuFeatures &= ~CPU_SSE4A;
}

if (UseSSE < 2)
  _cpuFeatures &= ~CPU_SSE2;

if (UseSSE < 1)
  _cpuFeatures &= ~CPU_SSE;

Note that proves the JVM is aware to some extent about SSE, it might not generate really effective codes for newer versions. Your mileage may vary.

like image 183
Greg Bowyer Avatar answered Oct 21 '22 02:10

Greg Bowyer