jvm

Why does -Xrs reduce performance

夙愿已清 提交于 2020-08-02 06:29:26
问题 From IBM: -Xrs Disables signal handling in the JVM. -Xrs Setting -Xrs prevents the Java™ run time environment from handling any internally or externally generated signals such as SIGSEGV and SIGABRT. Any signals that are raised are handled by the default operating system handlers. Disabling signal handling in the JVM reduces performance by approximately 2-4%, depending on the application. -Xrs:sync On UNIX systems, this option disables signal handling in the JVM for SIGSEGV, SIGFPE, SIGBUS,

The output -1 becomes a slash in the loop

拥有回忆 提交于 2020-07-31 06:48:27
问题 Surprisingly, the following code outputs: / -1 The code: public class LoopOutPut { public static void main(String[] args) { LoopOutPut loopOutPut = new LoopOutPut(); for (int i = 0; i < 30000; i++) { loopOutPut.test(); } } public void test() { int i = 8; while ((i -= 3) > 0) ; String value = i + ""; if (!value.equals("-1")) { System.out.println(value); System.out.println(i); } } } I tried many times to determine how many times this would occur, but, unfortunately, it was ultimately uncertain,

Invoking public methods with invokespecial?

血红的双手。 提交于 2020-07-22 05:03:45
问题 As anyone who can answer this question will already know, the JVM supports several bytecode instructions for invoking methods ( invokevirtual , invokespecial , invokestatic , ...) Most method calls on instance methods are made by invokevirtual , but private methods and initializer methods are called via invokespecial , as described in the JVM spec: The difference between the invokespecial and the invokevirtual instructions is that invokevirtual invokes a method based on the class of the

Add Java/JRE/JVM in Python Flask Cloud Foundry/IBM Cloud application

a 夏天 提交于 2020-07-21 07:58:32
问题 I am running a python flask application in a Cloud Foundry/IBM Cloud-environment. In my application I try to connect to DB2 Warehouse on Cloud with the IBMDBPY-package. This packages needs a package called jaydebeapi to be able to run. For the jaydebeapi to work I think I need JRE/JVM somehow installed on the server. I tried adding the Server JRE for Linux based OS, but it didn't work either. My error I got before I tried to upload the Sever JRE was this: idadb = IdaDataBase(dsn=jdbc)

I want to print hi GrandFather;but it seems to print hi father

扶醉桌前 提交于 2020-07-18 05:31:05
问题 I want to print hi GrandFather But it seems to print hi father. And I am not understand how to diff the use between findSpecial and findVirtual I want someone can help me. Thank you class GrandFather{ void thinking(){ System.out.println("hi GrandFather"); } } class Father extends GrandFather{ void thinking(){ System.out.println("hi Father"); } } class Son extends Father{ void thinking(){ MethodType mt=MethodType.methodType(void.class); //MethodHandle mh=MethodHandles.lookup().findVirtual

What is the role of operand stack in JVM? [closed]

冷暖自知 提交于 2020-07-15 05:57:54
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 months ago . Improve this question JVM Run-time Data Areas separate stack for each method being executed. It contains operand stack and local variables. Every time you load a variable, you need to const to the operand stack and then store to the local variables. Why not directly operate

Does JVM garbage collect objects being referenced by local variables which are no longer used? [duplicate]

本秂侑毒 提交于 2020-07-06 20:29:27
问题 This question already has answers here : Can java finalize an object when it is still in scope? (2 answers) Closed last year . As far as I know, a method's local variable is located in a stack frame in an executing thread and a reference type of a local variable only has a objects' reference, not the object itself. All of objects in JVM are located in a heap space. I want to know that objects referenced by local variables in a method being executed are never garbage collected until the end of

Does JVM garbage collect objects being referenced by local variables which are no longer used? [duplicate]

孤街醉人 提交于 2020-07-06 20:29:07
问题 This question already has answers here : Can java finalize an object when it is still in scope? (2 answers) Closed last year . As far as I know, a method's local variable is located in a stack frame in an executing thread and a reference type of a local variable only has a objects' reference, not the object itself. All of objects in JVM are located in a heap space. I want to know that objects referenced by local variables in a method being executed are never garbage collected until the end of

IllegalAccessError: Method is inaccessible to class

安稳与你 提交于 2020-07-04 16:35:16
问题 I've got very strange error, because it only happens after installing app from generated .apk . When I try to run the app through IDE, it works fine. java.lang.IllegalAccessError: Method 'int <package>.BaseActivity$Companion.getANIMATION_SLIDE_FROM_RIGHT()' is inaccessible to class '<package>.MyActivity' (declaration of '<package>.MyActivity' appears in /data/app/<package>-mg7eYmJ8hX5WvkNWNZWMVg==/base.apk!classes3.dex) As you can see there is class called BaseActivity which looks like this:

Recent books on JVM? [closed]

↘锁芯ラ 提交于 2020-07-04 05:42:16
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I'm after a book to learn about the internals of the Java virtual machine. I found this thread but it is two years old now. Are there