jvm-hotspot

Is Method area still present in Java 8?

孤街醉人 提交于 2020-01-12 09:16:56
问题 Prior to Java 8 we had 5 major runtime data areas: Method Area Heap JVM Stacks PC registers Native method stacks With Java 8, there is no Perm Gen, that means there is no more “java.lang.OutOfMemoryError: PermGen” which is great but I also read Method Area is part of space in the Perm Gen but I can't seem to find anything which explicitly says Method area is no more in Java 8. So is Perm Gen along with Method area got removed or only Perm Gen got removed and Method area is still present in

Is Method area still present in Java 8?

荒凉一梦 提交于 2020-01-12 09:15:30
问题 Prior to Java 8 we had 5 major runtime data areas: Method Area Heap JVM Stacks PC registers Native method stacks With Java 8, there is no Perm Gen, that means there is no more “java.lang.OutOfMemoryError: PermGen” which is great but I also read Method Area is part of space in the Perm Gen but I can't seem to find anything which explicitly says Method area is no more in Java 8. So is Perm Gen along with Method area got removed or only Perm Gen got removed and Method area is still present in

Exact state of committed memory in java

耗尽温柔 提交于 2020-01-11 15:30:30
问题 Im curious what the exact meaning of "committed" memory is when the value is queried from the MemoryUsage class. That class explains it as "committed represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine." Does this mean that the memory is in use by the jvm process and NOT available to other processes until it is released by the java process, or does it mean that the java process will be successful if it tries to allocate up to that

What is the difference between -Xss and -XX:ThreadStackSize?

亡梦爱人 提交于 2020-01-02 00:52:11
问题 I just want to control the stack size for all of my threads in a Java (groovy) application. For the Hotspot Oracle VM, I know that there are two parameters doing that (-Xss and XX:ThreadStackSize). Which is the preferred one? Is there any difference between them? Regarding Open JDK 7 someone asked on the mailing list, stating that -Xss is the same for the Hotpot VM as -XX:ThreadStackSize . The point is, that I am measuring how many threads can be started on my system. My groovy script which

Identify Java jdwp Debugger Assigned (Ephemeral) Port

折月煮酒 提交于 2019-12-30 05:03:10
问题 I am using the following JVM parameters to start-up a JVM with the hostpot debugger. -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=0 Note that I am assigning port zero, so that the JVM asks the OS for an ephemeral port. This is critical for my use-case, to make sure the JVM will not fail to start-up due to contention for some pre-defined port. As a result my JVM starts-up, and the following log entry is outputted to stdout : Listening for transport dt_socket at address: XXXX I would

Interpreting bytecode vs compiling bytecode?

丶灬走出姿态 提交于 2019-12-29 04:24:24
问题 I have come across a few references regarding the JVM/JIT activity where there appears to be a distinction made between compiling bytecode and interpreting bytecode. The particular comment stated bytecode is interpreted for the first 10000 runs and compiled thereafter. What is the difference between "compiling" and "interpreting" bytecode? 回答1: Interpreting byte code basically reads the bytecode line by line, doing no optimization or anything, and parsing it and executing it in realtime. This

Why I can't create an array with large size?

白昼怎懂夜的黑 提交于 2019-12-27 11:46:22
问题 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 maximum theoretical array size of 2147483647 elements. But as you can see my code doesn't work. It is also impossible to create an array with size new int[Integer.MAX_VALUE - 5]; Technical details 64-Bit HotSpot JVM OSX 10.10.4 PS And why -5 actually? 回答1: Theory There are two possible exceptions:

How does the JVM decided to JIT-compile a method (categorize a method as “hot”)?

爱⌒轻易说出口 提交于 2019-12-27 10:53:52
问题 I already worked with -XX:+PrintCompilation , and I know the basic techniques of the JIT-compiler and why JIT-compilation is used. Yet I still have not found out how the JVM decides to JIT-compile a method, i.e. "when the right time has come to JIT-compile a method". Am I right in the assumption that every method starts being interpreted, and as long as it is not categorized as "hot method" it will not be compiled? I have something in the back of my head that I read that a method is

What's the Mark-Compact algorithm used by HotSpot?

对着背影说爱祢 提交于 2019-12-24 07:26:06
问题 When reading the Mark-Compact chapter on The Garbage Collection Handbook, a sequence of alternatives were presented, but most of them looked old / theoretical (for instance, the 2-finger compaction and the Lisp2 3-pass approach requiring an extra header word per object). Is anyone aware of what algorithm does HotSpot uses when running Mark-Compact (in its old-generation, I assume)? Thanks 回答1: Big disclaimer: I am not a GC expert/writer; all the things that are written bellow are subject to

What performance benefits does Oracle's commercial Hotspot JVM have over OpenJDK?

北慕城南 提交于 2019-12-24 04:51:28
问题 As described in this question: OpenJDK vs Java HotspotVM Oracle's commercial Hotspot JVM is essentially OpenJDK, plus several commercial-client-only features. But - do these extra features actually contribute to performance on single machines and/or small clusters, with consumer-off-the-shelf hardware only? Or are they only relevant to large corporations with certain organizational needs and huge systems with custom hardware? I'm specifically asking about "Java Flight Recorder, Application