jvm

JVM - How much RAM should I allocate

自作多情 提交于 2021-01-28 18:35:58
问题 I didn't find a suggestion on how much RAM I actually should allocate to the JVM. Assuming that my computer has 4GB RAM and runs Windows 10. I nearly only use Java Applications on it. With how much RAM should I start the JVM? The system needs RAM for itself too, so in my logic, I should not allocate 4 GB even if that is possible. This isn't a black/white question, I just want to have an idea and how to come to an answer in this question. 回答1: I didn't find a suggestion on how much RAM I

What are the main glaring differences between the JVM and KVM?

天大地大妈咪最大 提交于 2021-01-28 13:47:07
问题 I'm learning Java for a course this month, and this question is just one I thought of that I'd like to know. What are the main differences between these two? I know KVM is targeted for mobile devices, correct? 回答1: The KVM is specifically optimized for use with devices with 128k - 256k available memory. It is developed for use with J2ME. The JVM has additional libraries and functionality that the KVM does not have out of the box (but these libraries can be added to the KVM as needed). More

Not able to set JVM heap size on AWS Elastic Beanstalk Java SE Platform

眉间皱痕 提交于 2021-01-28 13:30:35
问题 I have a Spring Boot app deployend on Elastic Beanstalk using a single EC2 t2.micro instance (1GB RAM). I need to increase my app's JVM Heap size but I'm not being able to do so. The things I have tried are: Setting a JAVA_OPTS variable in the enviroment configuration in the EB console with the value -Xms512m -Xmx896m . Deploying the app with a Procfile in the project root folder what contains the following line: web: java -jar <relative-path-to-jar> -Xms512m -Xmx896m What else could I try?

Has this method ever been called inside a running JVM

僤鯓⒐⒋嵵緔 提交于 2021-01-28 12:43:55
问题 Is there a way to figure out if a method ever been called inside running JVM. Let's say I have the following method information and I want to know if it has ever been called: "methodId": { "className": "InvokerParser", "filePath": "org/foo/commons/functors/InvokerParserformer.java", "methodName": "parser" } 回答1: If the application is running on HotSpot JVM, it is possible to get the information about the given method using HotSpot Serviceability Agent. Here is a tool that checks whether the

Has this method ever been called inside a running JVM

試著忘記壹切 提交于 2021-01-28 12:33:07
问题 Is there a way to figure out if a method ever been called inside running JVM. Let's say I have the following method information and I want to know if it has ever been called: "methodId": { "className": "InvokerParser", "filePath": "org/foo/commons/functors/InvokerParserformer.java", "methodName": "parser" } 回答1: If the application is running on HotSpot JVM, it is possible to get the information about the given method using HotSpot Serviceability Agent. Here is a tool that checks whether the

How to get the full stacktrace of a StackOverflowError without restarting the application

╄→гoц情女王★ 提交于 2021-01-28 11:14:31
问题 I currently hava a running Java application, which has a bug. I don't know how to fully reproduce it and it didn't happen for weeks until now. When it occurs one times, I can reproduce it over and over again easily until I restart the application. The bug causes a StackOverflowError because of a recursion and I don't know how this happens. The printed stacktrace of the StackOverflowError isn't helpful because it contains only the repeating part, but not the more insteresting initial part,

How to handle the unsigned types (especially u4) of a Java class file in a Java program?

本小妞迷上赌 提交于 2021-01-28 05:54:39
问题 From the Java Virtual Machine specification: A class file consists of a stream of 8-bit bytes. All 16-bit, 32-bit, and 64-bit quantities are constructed by reading in two, four, and eight consecutive 8-bit bytes, respectively. Multibyte data items are always stored in big-endian order, where the high bytes come first. In the Java platform, this format is supported by interfaces java.io.DataInput and java.io.DataOutput and classes such as java.io.DataInputStream and java.io.DataOutputStream.

Unrecognized option: -MaxMetaspaceSize=256m

允我心安 提交于 2021-01-28 05:05:49
问题 While ordinary run under IDEA I've got: /usr/lib/jvm/java-8-oracle/jre/bin/java ... Unrecognized option: -MaxMetaspaceSize=256m Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Process finished with exit code 1 Why can't I add the -MaxMetaspaceSize=256m JVM property? Additional info: echo $JAVA_HOME /usr/lib/jvm/java-8-oracle/lib sudo update-alternatives --config java There are 2 choices for the alternative java (providing /usr/bin

Unrecognized option: -MaxMetaspaceSize=256m

与世无争的帅哥 提交于 2021-01-28 05:00:23
问题 While ordinary run under IDEA I've got: /usr/lib/jvm/java-8-oracle/jre/bin/java ... Unrecognized option: -MaxMetaspaceSize=256m Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Process finished with exit code 1 Why can't I add the -MaxMetaspaceSize=256m JVM property? Additional info: echo $JAVA_HOME /usr/lib/jvm/java-8-oracle/lib sudo update-alternatives --config java There are 2 choices for the alternative java (providing /usr/bin

Retrieve annotations from KType

对着背影说爱祢 提交于 2021-01-28 03:24:37
问题 I have a simple TYPE_USE annotation: @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) public @interface Cool { } And the following sample Kotlin class: class Item( id: Long? = null, var names: List<@Cool String> = emptyList()) Is there any way to extract the annotation using Java reflection? Item.class.getMethod("getName").getAnnotatedReturnType() loses the annotations, same with getting the field. Can I even get the annotation from Kotlin? Item: