jvm-hotspot

HotSpot JIT inlining strategy: top-down or down-top

妖精的绣舞 提交于 2019-12-17 16:07:19
问题 Suppose we have 3 methods: method 2 is called from method 1, method 3 is called from method 2. Methods 2 and 3 are of size 30 bytecodes each. Also, suppose for definiteness method 2 is always called from method 1 exactly once, and method 3 is always called from method 2 exaclty once. If method 2 is inlined first, method 3 will be called from the body of method 1 directly, and could be inlined in its turn. If method 3 is inlined into method 2 first, the size of the latter will become about 60

What does Oop Maps means in Hotspot VM exactly

旧城冷巷雨未停 提交于 2019-12-17 10:54:22
问题 I read from some documents that Hotspot VM utilizes a data structure called Oop Maps to manage all OOPs in VM. My question is that when does this Oop Map data structure generated? At compile time or runtime? Any further detailed documents regarding to this will be more than welcomed. Thank you guys. 回答1: OopMap is a structure that records where object references (OOPs) are located on the Java stack. Its primary purpose is to find GC roots on Java stacks and to update the references whenever

Encourage the JVM to GC rather than grow the heap?

妖精的绣舞 提交于 2019-12-17 10:46:19
问题 (Note that when I say "JVM", I really mean "Hotspot", and I'm running the latest Java 1.6 update.) Example situation: My JVM is running with -Xmx set to 1gb. Currently, the heap has 500mb allocated, of which 450mb is used. The program needs to load another 200 mb on the heap. Currently, there is 300mb worth of "collectable" garbage in the heap (we'll assume it's all in the oldest generation.) Under normal operation, the JVM will grow the heap to 700 mb or so, and garbage collect when it gets

When can Hotspot allocate objects on the stack? [duplicate]

只愿长相守 提交于 2019-12-17 10:34:41
问题 This question already has answers here : Eligibility for escape analysis / stack allocation with Java 7 (3 answers) Closed 2 years ago . 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 generated code and reduces pressure on the garbage collector. What are the rules for when Hotspot is able to stack allocate objects? In other words when can I rely on

Read Java JVM startup parameters (eg -Xmx)

孤人 提交于 2019-12-17 05:41:25
问题 I'm trying to figure out if there's a way to determine the JVM startup properties from within a running java process. Specifically I'm trying to find out where parameters such as -Xmx (max heap size) and -XX:MaxPermSize are stored. I'm running Sun's 1.6 jvm. If you're wondering why I want to do this, I have a number of JVM webservers that may or may not be configured correctly and I want to add this to the startup code check. It's much easier for me to check in a piece of java code that gets

Is it possible to do Hotswapping of ATG classes

落爺英雄遲暮 提交于 2019-12-14 04:16:26
问题 The deployment we follow is that we use runAssembler.bat to build an ear file and deploy it in a app server. We are using weblogic and jboss for testing purposes of the modules we built. However for every small change, we need to run runAssembler and build a new ear and deploy it in app server and restart the server. I would like to find out if anyone figured out a way to do Hotswapping of class files which are generated by the code we write in ATG environment in either weblogic or jboss. 回答1

How does HotSpot JVM identify hot methods?

ぐ巨炮叔叔 提交于 2019-12-13 22:25:43
问题 I want to understand how JVM works and I have been reading blog posts and documentation. However, things are quite confusing and frequently outdated. I understand as methods get invoked more and more (10k or 15k invocations threshold depending on compiler), JVM JIT compiles them to native code and maintains a code cache. I am interested in browsing the actual source code where these decisions are being made. This post explains things well. However, I am using OpenJDK11 and the structure of

What is a `monitor` in JVM(Hotspot), a specific object? [duplicate]

99封情书 提交于 2019-12-13 03:21:05
问题 This question already has answers here : What's a monitor in Java? (7 answers) Semaphore vs. Monitors - what's the difference? (6 answers) Closed 12 months ago . In Java Language Spec, Section 17.1: Synchronization, it says Each object in Java is associated with a monitor, which a thread can lock or unlock. Section 17.2: Every object, in addition to having an associated monitor, has an associated wait set. A wait set is a set of threads. When an object is first created, its wait set is empty.

How to use uprobe to trace OpenJDK HotSpot source code?

旧时模样 提交于 2019-12-13 03:19:47
问题 I try to follow the instructions from link In this example, Tracing func_abc() in my test program, and including user-level stacks: # ./uprobe -s p:/root/func_abc:func_c Tracing uprobe func_c (p:func_c /root/func_abc:0x4f4). Ctrl-C to end. func_abc-25394 [000] d... 19603250.054040: func_c: (0x4004f4) func_abc-25394 [000] d... 19603250.054056: <user stack trace> => <00000000004004f4> => <0000000000400527> => <0000000000400537> => <00007fca9f0e376d> func_abc-25394 [000] d... 19603251.054250:

IllegalArgumentException when trying to handle SIGBREAK in Hotspot JVM on Windows

白昼怎懂夜的黑 提交于 2019-12-12 03:46:39
问题 I'm trying to use the signal handling classes in the sun.misc package (as documented here) to handle SIGBREAK in Hotspot JVM on Windows so I can trigger shutdown on Ctrl+Break instead of just dumping threads. However, I'm running into a situation where it throws an IllegalArgumentException saying that SIGBREAK is already being handled by the OS or the VM when I try to set up the handler. This happens even when I run the JVM with the -Xrs flag which supposedly disables handling of the SIGBREAK