jvm-hotspot

What are the differences between JVisualVM and Java Mission Control?

元气小坏坏 提交于 2019-12-03 06:28:17
问题 Other than the more 'advanced' GUI from Java mission control, how are they different? At first glance they seem to offer very similar functionality (Interpreting JMX data and Memory/CPU profiling). However, as they are both shipped with the JDK (I'm using JDK 1.7.0_51 SE) I'm assuming there are significant differences, otherwise they would be combined into a single solution. Especially as this increases the size of the JDK significantly. Is Java Mission Control ultimately going to replace

Oracle's Server JRE Contains JDK?

纵饮孤独 提交于 2019-12-03 06:08:53
I've just downloaded Oracle's Server JRE for Java SE 7 ( link ) The file I downloaded was server-jre-7u45-linux-x64.tar.gz . When I extracted this file I was surprised to find a directory named jdk1.7.0_45 was created containing the full java JDK. Not what I expected from a JRE install. What is going on here? The answer is in the description of the packages on the parent page: JDK: (Java Development Kit). For Java Developers. Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications. Server JRE: (Server Java Runtime Environment) For deploying Java

java PrintCompilation output: what's the meaning of “made not entrant” and “made zombie”

旧巷老猫 提交于 2019-12-03 01:38:06
问题 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 text made not entrant and made zombie . What do these mean? Best guess is that it's a decompilation step before recompiling either that method or a dependency with greater optimisation. Is that true? Why "zombie" and "entrant"? Example, with quite a bit of time between some of these lines: [... near

How is ArrayOutOfBoundsException possible in String.valueOf(int)?

陌路散爱 提交于 2019-12-03 01:12:21
Why does this code sometimes produce ArrayOutOfBoundsException? How is that even possible for String.valueOf(int) ? public static String ipToString(ByteString bs) { if (bs == null || bs.isEmpty()) { return null; } else { StringBuilder sb = new StringBuilder(); boolean started = false; for (Byte byt : bs) { if (started) { sb.append("."); } sb.append(String.valueOf(byt & 0xFF)); started = true; } return sb.toString(); } } java.lang.ArrayIndexOutOfBoundsException: -81914 at java.lang.Integer.getChars(Integer.java:458) at java.lang.Integer.toString(Integer.java:402) at java.lang.String.valueOf

How do I programmatically find out my PermGen space usage?

℡╲_俬逩灬. 提交于 2019-12-03 01:12:08
问题 I'm trying to diagnose a java.lang.OutOfMemoryError: PermGen Space error when running on Sun's Hotspot JVM, and would like to know how much PermGen space my program is using at various points. Is there a way of finding out this information programmatically? 回答1: You can use something like this: Iterator<MemoryPoolMXBean> iter = ManagementFactory.getMemoryPoolMXBeans().iterator(); while (iter.hasNext()) { MemoryPoolMXBean item = iter.next(); String name = item.getName(); MemoryType type = item

Useless test instruction?

谁都会走 提交于 2019-12-03 01:03:56
I got the below assembly list as result for JIT compilation for my java program. mov 0x14(%rsp),%r10d inc %r10d mov 0x1c(%rsp),%r8d inc %r8d test %eax,(%r11) ; <--- this instruction mov (%rsp),%r9 mov 0x40(%rsp),%r14d mov 0x18(%rsp),%r11d mov %ebp,%r13d mov 0x8(%rsp),%rbx mov 0x20(%rsp),%rbp mov 0x10(%rsp),%ecx mov 0x28(%rsp),%rax movzbl 0x18(%r9),%edi movslq %r8d,%rsi cmp 0x30(%rsp),%rsi jge 0x00007fd3d27c4f17 My understanding the test instruction is useless here because the main idea of the test is The flags SF, ZF, PF are modified while the result of the AND is discarded. and here we don't

Hotspot7 hsdis PrintAssembly Intel Syntax

夙愿已清 提交于 2019-12-02 23:02:02
It annoys me every time I use -XX:+PrintAssembly with Hotspot and have to read the horrible AT&T syntax. Is there a way to tell it to use the Intel syntax? All you need is to parse some options onto the dis-asm.h and binutils code For intel Asm (which I also prefer) just add the following -XX:PrintAssemblyOptions=intel If you need to combine options do it with commas like so -XX:PrintAssemblyOptions=intel,hsdis-help Anything not recognised as a hsdis option will be fed to the disassembler, these options are the same ones you see listed from objdump --help ... <SNIP A lot of --help text %<> ...

Why does Java , running in -server mode, say that the version is “mixed-mode”?

心不动则不痛 提交于 2019-12-02 20:28:06
Why does Java , running in -server mode, say that the version is "mixed-mode" ? When I see that, does it mean that the JVM didn't truly load in pure server mode? server mode does not mean "not mixed". Those are different settings. Mixed does mean that the JVM will mix compiled and interpreted code. You could optionally switch to fully interpreted mode with the switch -Xint (usually you don't want to do this). Server mode means that the hot-spot-compiler will run with server-settings. The general assumption is that VMs in server-mode are long-running, so optimizations will be done with this in

Exact state of committed memory in java

十年热恋 提交于 2019-12-02 17:19:26
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 amount of memory? I realize this might be implementation specific but i am only interested in hotspot.

Substituting JVM oop pointer in C++

扶醉桌前 提交于 2019-12-02 16:38:33
问题 So I decided that the "easiest" way to answer my other question is to "simply" look at the implementation of the unsafe in C/C++. ( In a nutshell, I have an Object base and a long offset in Java, that I'm passing to C/C++ by means of the Java Native Interface (JNI), from where I want to execute the C/C++ equivalent of unsafe.setInt(base,offset,1) ) Such an implementation is provided, for example, by the OpenJDK: unsafe.cpp I don't care about most that's in there, I just want a direct access