jvm-hotspot Questions
3
Solved
I have a Java loop that looks like this:
public void testMethod() {
int[] nums = new int[10];
for (int i = 0; i < nums.length; i++) {
nums[i] = 0x42;
}
}
The assembly I get is this:
0x...
Shinny asked 16/5, 2018 at 16:36
1
Solved
I know that one of the criteria that Java HotSpot uses to decide whether a method is worth inlining is how large it the method is. On one hand, this seems sensible: if the method is large, in-linin...
Lour asked 2/5, 2018 at 19:0
2
Solved
(note: proper answer must go beyond reproduction).
After millions of invocations, quicksort1 is definitely faster than quicksort2, which have identical code aside from this 1 extra arg.
The code...
Weimaraner asked 10/4, 2018 at 12:52
2
Solved
In HTOP you can see the RES value (resident size) which shows how much of your RAM your JVM process is really taking.
Now I want to get that value by only using pure Java. If you tell me it's just...
Cooe asked 31/10, 2014 at 14:24
2
Solved
Intro:
At university one learns that typical garbage collection roots in Java (and similar languages) are static variables of loaded classes, thread-local variables of currently running thre...
Aphasic asked 13/3, 2018 at 10:57
1
Solved
Here's the example I tried to reproduce from Java Performance: The Definitive Guide, Page 97 on the topic of Escape Analysis. This is probably what should happen:
getSum() must get hot enough and...
Instability asked 11/3, 2018 at 7:32
4
Solved
When running a Java 1.6 (1.6.0_03-b05) app I've added the -XX:+PrintCompilation flag. On the output for some methods, in particular some of those that I know are getting called a lot, I see the tex...
Fabiolafabiolas asked 28/5, 2010 at 16:41
1
Solved
Imagine that I define a class with dozens of reference fields (instead of using reference arrays such as Object[]), and instantiate this class pretty heavily in an application.
Is it going to affe...
Bora asked 5/3, 2018 at 8:31
5
Solved
Why it is impossible to create an array with max int size?
int i = 2147483647;
int[] array = new int[i];
I found this explanation:
Java arrays are accessed via 32-bit ints, resulting in a max...
Descent asked 13/7, 2015 at 11:46
2
Solved
I found this question that answered it for C++:
How do you get assembler output from C/C++ source in gcc?
Janinajanine asked 19/6, 2015 at 2:5
1
Solved
Pure methods are those without side effects: their only effect is to return a value which is a function of their arguments.
Two calls to the same pure method with the same arguments will return th...
Key asked 1/1, 2018 at 4:29
2
Solved
Short of the reading the OpenJDK source code (which I'm not averse to) is there a reasonably comprehensive (or 'official') list of intrinsic operations within the Hotspot JVM (say for Intel)?
For ...
Coextend asked 18/4, 2015 at 19:1
2
An OutOfMemoryError occurs when the heap does not have enough memory to create new objects. If the heap does not have enough memory, where is the OutOfMemoryError object created. I am trying to und...
Rhodie asked 19/9, 2017 at 6:14
1
Solved
In HotSpot JVM GC Tuning Guide the UseGCOverheadLimit option is mentioned only on the pages about CMS and Parallel GCs. Additionally, on GC Ergonomics doc page the related options GCTimeLimit and G...
Trainband asked 28/8, 2017 at 19:19
2
Solved
I was benchmarking some code, and I could not get it to run as fast as with java.math.BigInteger, even when using the exact same algorithm.
So I copied java.math.BigInteger source into my own packa...
Clair asked 28/8, 2017 at 5:55
1
Solved
The Question came out when i was learning java.lang.String Java API.
I found an article in Chinese.
Java 中new String("字面量") 中 "字面量" 是何时进入字符串常量池的?
it said,CONSTANT_String is lazy resolve in HotSpo...
Orban asked 5/7, 2017 at 11:7
1
After making some changes to an application it suffered a significant performance degradation and on investigation one of the most frequently called methods is no longer being compiled. Turning on:...
Shantel asked 29/6, 2017 at 0:30
1
Solved
Here is an excerpt of the output that I get when I run the following command (40 is just an arg to the Fibonacci program) :
java -XX:+UnlockDiagnosticVMOptions -XX:CompileCommand="print Fibonacci:...
Bondy asked 23/6, 2017 at 22:2
3
Solved
I am reading about the feature in Java 8 update 20 for String deduplication (more info) but I am not sure if this basically makes String.intern() obsolete.
I know that this JVM feature needs the ...
Accuse asked 29/9, 2015 at 22:46
2
Solved
I am write a Java Agent to instrument a target Method of a target Class.
I use the javassist library to do instrument.
So the java agent (let named CnAgent.class) need its dependency : javassist...
Em asked 9/10, 2014 at 13:59
2
Solved
I looked at this post. It looks nice. However the authors or other aware people will tell me tricks with coding when HotSpot (does not depend on server or client or not Sun version) makes a c...
Abeabeam asked 12/10, 2011 at 17:41
2
Solved
As the title states, why doesn't the OpenJDK JVM emit prefetch instruction on Windows x86? See OpenJDK Mercurial @ http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/c49dcaf78a65/src/os_cpu/window...
Seller asked 4/6, 2017 at 14:34
2
Solved
Considering the code:
someList.forEach(x -> System.out.format("element %s", x));
Theoretically, it should be possible to inline this code and eliminate the indirect function calls by first in...
Socket asked 24/5, 2017 at 14:36
1
Solved
Besides official documentation I have found only this post. But it is quite old and incomplete (only -XX options available).
For example, I couldn't find -XX:AutoBoxCacheMax option in none of...
Praetor asked 29/3, 2017 at 8:7
1
Solved
Since somewhere around Java 6, the Hotspot JVM can do escape analysis and allocate non-escaping objects on the stack instead of on the garbage collected heap. This results in a speedup of the...
Hizar asked 24/3, 2017 at 14:48
© 2022 - 2024 — McMap. All rights reserved.