jvm-hotspot

Just in Time Compilation - Storing vs Doing always [duplicate]

霸气de小男生 提交于 2019-12-06 02:58:27
Possible Duplicate: Why doesn't the JVM cache JIT compiled code? I understand that JIT compilation is compilation to native code using hotspot mechanisms, which can be very very fast as it is optimization to the OS, Hardwards, etc. My question is, why does Java not store that JIT complied code somewhere in file and use the same for future purposes? This can reduce the 'initial warm-up' time as well. Please let me know what I am missing here. To add to my question: Why does not Java complie the complete code to native and use that always(for a specific JVM,OS, platform)? Why JIT? If I remember

What is vmovdqu doing here?

与世无争的帅哥 提交于 2019-12-05 20:34:25
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: 0x00000001296ac845: cmp %r10d,%ebp 0x00000001296ac848: jae 0x00000001296ac8b4 0x00000001296ac84a: movl $0x42,0x10(%rbx,%rbp,4) 0x00000001296ac852: inc %ebp 0x00000001296ac854: cmp %r11d,%ebp 0x00000001296ac857: jl 0x00000001296ac845 0x00000001296ac859: mov %r10d,%r8d 0x00000001296ac85c: add $0xfffffffd,%r8d 0x00000001296ac860: mov $0x80000000,%r9d 0x00000001296ac866: cmp %r8d,%r10d 0x00000001296ac869: cmovl %r9d,

Java create wifi hotspot in Windows 8

蓝咒 提交于 2019-12-05 18:34:56
I need to create a wifi hotspot and a DHCP server in Windows 7-8 with Java. I'm developing a software that could be for the user less intrusive and simple that i could. For the first part of my work, I thought to use netsh to create the hosted network and to set static the ip. my current code is this: String[] command = { "cmd", }; Process p = Runtime.getRuntime().exec(command); new Thread(new SyncPipe(p.getErrorStream(), System.err)).start(); new Thread(new SyncPipe(p.getInputStream(), System.out)).start(); PrintWriter stdin = new PrintWriter(p.getOutputStream()); //now I use the stdin

Change JVM JIT Options at runtime

僤鯓⒐⒋嵵緔 提交于 2019-12-05 18:16:19
Is it possible to change options and/or modes of Java JVM (JIT) at runtime? E.g. change XX:CompileThreshold, or even switch between interpreted and compiled code ( -Xcomp vs -Xint ). My JVM is from OpenJDK (1.6), Hotspot or Zero/Shark You cannot change the JVM mode at runtime, however you can modify some flags without restarting the JVM. Just connect to the JVM using a JMX client (like VisualVM) and use the operation setVMOption of com.sun.management:type=HotSpotDiagnostic . For instance, if you want to enable detailed GC logging without restarting the JVM, call the method setVMOptions(

Why do hotspot generated compiled methods stash eax high up the stack before execution?

为君一笑 提交于 2019-12-05 12:42:31
When looking at generated assembly code from OpenJDK's HotSpot, there is part of the prologue that copies the %eax value to a location further up the stack (rsp-0x14000) , and I don't understand why it's doing that: [Disassembling for mach='i386:x86-64'] [Entry Point] [Verified Entry Point] [Constants] # {method} {0x0000000120f0f410} 'add' '(JJ)J' in 'Test' # parm0: rsi:rsi = long # parm1: rdx:rdx = long # [sp+0x40] (sp of caller) 0x000000010cd8a3e0: mov %eax,-0x14000(%rsp) 0x000000010cd8a3e7: push %rbp 0x000000010cd8a3e8: sub $0x30,%rsp 0x000000010cd8a3ec: movabs $0x120f0f5d0,%rax ; {metadata

Invalid access of stack red zone from Java VM

人走茶凉 提交于 2019-12-05 11:51:56
问题 I'm trying to figure out what can cause this error in Java: Invalid access of stack red zone 0x115ee0ed0 rip=0x114973900 Has anyone ever encountered this error message? It's literally killing the JVM and everything stops there. I'm currently using this version of Java:(on OS X 10.6) java version "1.6.0_15" Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219) Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode) All I'm looking for is some sort of explanation and tips on how to

Performance of Collections.emptyList and empty ArrayList with JIT compiler

五迷三道 提交于 2019-12-05 06:05:22
Is there a performance difference between using Collections.emptyList() or an empty ArrayList , especially when using a JIT compiler? I could imagine that - for example - the JIT compiler doesn't do inlining or static method calls because the executed method depends on the type. Edit I know that Collections.emptyList() returns an immutable list while ArrayList is mutable object. What I mean is that if I pass one or the other to a method as a parameter and the method doesn't modify the list does that restrict the possibilities for the JIT compiler to optimize the method? A simple example (just

How to retransform an executing method with JVMTI agent which has no further invocations?

Deadly 提交于 2019-12-05 02:21:58
I am instrumenting a class file during runtime for various purposes. I'm using a JVMTI agent to that end. My strategy to instrument a method is to call RetransformClasses function to invoke ClassFileLoadHook . This strategy works fine for all the methods which have any further invocation after the time of instrumentation because actual instrumentation happens at subsequent function call, but it doesn't work for any method which does not have further invocations like main function in a program. I want to instrument a method on the fly during its execution. I want some procedure like On-Stack

Determining whether a particular JDK Method typically has an intrinsic implementation

拜拜、爱过 提交于 2019-12-04 19:25:36
问题 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 example, what's the quickest way to determine whether Math.abs() will generally be converted directly to a few native instructions wherever it is used? 回答1: The relevant part of the OpenJDK source code states: http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/87ee5ee27509/src/share/vm/classfile

What are the differences in JIT between Java and .Net

早过忘川 提交于 2019-12-04 16:48:36
问题 I know Microsoft .NET uses the CLR as a JIT compiler while Java has the Hotspot. What Are the differences between them? 回答1: They are very different beasts. As people pointed out, the CLR compiles to machine code before it executes a piece of MSIL. This allows it in addition to the typical dead-code elimination and inlining off privates optimizations to take advantage of the particular CPU architecture of the target machine (though I'm not sure whether it does it). This also incurs a hit for