jvm-arguments

Gradle does not honor --add-modules jvm argument in JDK9

送分小仙女□ 提交于 2019-12-22 09:29:58
问题 I am trying JDK9 (9-ea+143), and need to set --add-modules java.xml.bind . I have tried: Setting GRADLE_OPTS="--add-modules java.xml.bind '-Dorg.gradle.jvmargs=--add-modules java.xml.bind'" Setting org.gradle.jvmargs=--add-modules java.xml.bind in gradle.properties. Adding test { jvmArgs '--add-modules java.xml.bind' } to build.gradle Adding tasks.withType(Test) { jvmArgs '--add-modules java.xml.bind' } to build.gradle Adding tasks.withType(JavaExec) { jvmArgs '--add-modules java.xml.bind' }

Is there a way to increase Java heap space in the code itself? [duplicate]

落爺英雄遲暮 提交于 2019-12-22 06:43:45
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Is it possible to dynamically change maximum java heap size? I know there is an XMX option for the Java launcher, but is there some kind of preprocessing directive that does this instead (so that all computers that run my code will have their heap increased). As it is right now, java.exe reaches ~280MB max only (before it crashes) - is this normal? 回答1: "launch a new Process with more memory" can this be done in

Can't set memory settings for `sbt start`

余生颓废 提交于 2019-12-22 04:12:28
问题 I'm trying to run sbt start in a Play Framework application written in Scala, on a machine that is an ec2 t2.micro instance on AWS. But i can't because There is insufficient memory for the Java Runtime Environment to continue. The machine has 1GB of memory, but in practice 930MB of free memory to use while running the remaining of OS processes. It is Ubuntu Server 14.04 LTS. The app is small, cute. Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000d5550000,

Unrecognized VM option '+HeapDumpOnCtrlBreak'

我们两清 提交于 2019-12-21 21:29:32
问题 I'm using Jboss and I added -XX:+HeapDumpOnCtrlBreak option to JAVA_OPTS. But I got the error when starting Jboss: Unrecognized VM option '+HeapDumpOnCtrlBreak' Could not create the Java virtual machine. I've searched on the net and it seems JDK 6 doesn't support this option so I changed to jdk1.5.0_09 but still got this error. Does anyone know what's wrong? 回答1: the option doesn't work even on JDK 1.7 update 25: >>java -version java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1

How can I OOM sooner in excessive GC? [duplicate]

狂风中的少年 提交于 2019-12-21 16:58:17
问题 This question already has an answer here : Adjusting GC Overhead Exceeded parameters (1 answer) Closed 2 years ago . Occasionally my JVM runs out of memory, but rather then OOMing which I can recover from (or heapDumpOnOOM and debug) it tends to thrash in GC for hours before throwing out of memory. This is essentially the same as the (unanswered) question: How can I configure the Java GC Overhead Limit? But I suspect the answer is you can't tune the 98%/2% thresholds, so I'm asking of any way

What is the difference between JDK_JAVA_OPTIONS and JAVA_TOOL_OPTIONS when using Java 11?

扶醉桌前 提交于 2019-12-21 09:13:01
问题 What is the exact difference between JDK_JAVA_OPTIONS and JAVA_TOOL_OPTIONS when using Java 11? They seem to do the same, but the output is slightly different. That makes me believe they might have different use cases: $ JDK_JAVA_OPTIONS="-Dstuff" java Foo NOTE: Picked up JDK_JAVA_OPTIONS: -Dstuff $ JDK_JAVA_OPTIONS="illegalStuff" java Foo NOTE: Picked up JDK_JAVA_OPTIONS: illegalStuff Error: Cannot specify main class in environment variable JDK_JAVA_OPTIONS $ JAVA_TOOL_OPTIONS="-Dstuff" java

How do I get an error message when failing to load a JVM via JNI?

≡放荡痞女 提交于 2019-12-21 02:51:24
问题 I would like to retrieve an error message that explains why the jvm failed to load. From the examples provided here: http://java.sun.com/docs/books/jni/html/invoke.html I extracted this example: /* Create the Java VM */ res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args); if (res < 0) { // retrieve verbose error here? fprintf(stderr, "Can't create Java VM\n"); exit(1); } In my specific case I'm providing invalid arguments in the vm_args and would expect to see what I get on the command line:

Can I force the JVM to natively compile a given method?

半城伤御伤魂 提交于 2019-12-20 08:48:28
问题 I have a performance-critical method called often when my app starts up. Eventually, it gets JIT-compiled, but not after some noticeable time being run in the interpreter. Is there any way I can tell the JVM that I want this method compiled right from the start (without tweaking other internals with stuff like -XX:CompileThreshold )? 回答1: The only way I know of is the -Xcomp flag, but that is not generally advisable to use. It forces immediate JIT compilation of ALL classes and methods first

how to change jvm parameters on the Microsoft Azure website

独自空忆成欢 提交于 2019-12-20 04:11:10
问题 I created a java-based website on Azure, and selected tomcat as container when used "CUSTOM CREATE", then there is an empty website ready and I can upload WAR files using ftp but not able to touch tomcat files. I need change the heap size of JVM, how to do that? 回答1: please see http://azure.microsoft.com/en-us/documentation/articles/web-sites-java-custom-upload/ - see section "Tomcat". You could either upload your own tomcat as mentioned in this link OR you can just configure httpPlatform

Specify options for the jvm launched by pyspark

夙愿已清 提交于 2019-12-20 03:01:10
问题 How /where are the jvm options used by the pyspark script when launching the jvm it connects to specified? I am specifically interested in specifying jvm debugging options e.g. -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 Thanks. 回答1: pyspark uses the bin/spark-class script to start the client that you see running in your terminal / console. You can just append whatever options necessary to JAVA_OPTS : JAVA_OPTS="$JAVA_OPTS -Xmx=2g -Xms=1g -agentlib:jdwp=transport=dt