jvm-arguments

How to specify firstDayOfWeek for java.util.Calendar using a JVM argument

I'm trying to change default firstDayOfWeek for java.util.Calendar from SUNDAY to MONDAY. Is it possible to achieve this through JVM configuration instead of adding this piece of code? cal.setFirstDayOfWeek(Calendar.MONDAY); ...

Putting JVM arguments in a file to be picked up at runtime

I'm building a jar of my current application, which required several JVM arguments to be set. Is there a way of setting these JVM arguments in a file rather than on the command line? I've done some hunting and it looks like I might be able to do something witha java.properties file, possibly by setting a java-args, but I can't find any...

Debug a java application without starting the JVM with debug arguments

Normally to attach a debuger to a running jvm you would need start the jvm with arguments such as the following: > java -Xdebug -Xrunjdwp:transport=dt_socket,address=1000,server=y,suspend=n Now if I want to debug a process that wasn't started in debug mode, what can I do? This situatoin arrises when a production system (ie started wi...

JVM performance tuning for large applications

The default JVM parameters are not optimal for running large applications. Any insights from people who have tuned it on a real application would be helpful. We are running the application on a 32-bit windows machine, where the client JVM is used by default. We have added -server and changed the NewRatio to 1:3 (A larger young generation...

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

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? f...

How can one send a Ctrl-Break to a running Linux process?

I am debugging a memory leak in an application running on Sun's JDK 1.4.2_18. It appears that this version supports the command line param -XX:+HeapDumpOnCtrlBreak which supposedly causes the JVM to dump heap when it encounters a control-break. How does one send this to a background process on a Linux box? It appears that kill signals...

Speed tradeoff of Java's -Xms and -Xmx options

Given these two commands A: $ java -Xms10G -Xmx10G myjavacode input.txt B: $ java -Xms5G -Xmx5G myjavacode input.txt I have two questions: Since command A reserves more memory with its parameters, will A run faster than B? How do -Xmx and -Xms affect the running process and the output of my program? ...

JVM -XX:+StringCache argument?

I was recently reading about all the JVM arguments available in JRE 6 [Java VM Options] and saw this : -XX:+StringCache : Enables caching of commonly allocated strings. Now I was always under the impression that Java kept a pool of interned (correct word?) Strings and when doing something like String concatenation with literals it...

JVM heap parameters

Hi all, After reading already asked question on the subject and a lot of googling I am still not able to have a clear view of -Xms option My question is: what's the difference between java -Xms=512m -Xmx=512m and java -Xms=64m -Xmx=512m ? For now I have the following answer: The only difference is in the number of garbage collections...

What is Java's -XX:+UseMembar parameter

I see this parameter in all kinds of places (forums, etc.) and the common answer it help highly concurrent servers. Still, I cannot find an official documentation from sun explaining what it does. Also, was it added in Java 6 or did it exist in Java 5? (BTW, a good place for many hotspot VM parameters is this page) Update: Java 5 does ...

How to get vm arguments from inside of java application?

Hello, I need to check if some option which can be passed to JVM is explicitly set or is it have default value. To be more specific: I need to create one specific thread with higher native stack size than the default one, but in case then user want to take care of such things by himself by specifying -Xss option I want to create all thre...

Retrieve main class/jar file name passed to the JVM

As a C++ app, is there a way to query a java process(java.exe/javaw.exe) to retrieve the main class or jar file name that was passed to the JVM? I want the same result as when you run "jps -l": C:\>jps -l -V 2644 sun.tools.jps.Jps 4340 net.sourceforge.squirrel_sql.client.Main I think I could get the command line parameter and try to p...

Runing java with JAVA_OPTS env variable

Greetings, In a shell script,I have setup JAVA_OPTS environment(to enable remote debuggin and increase memory) and then execute the jar file as follows: export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n -Xms512m -Xmx512m" java -jar analyse.jar $* But it seems theres no effect of JAVA_OPTS env var...

Difference between -XX:UseParallelGC and -XX:+UseParNewGC

They are algorithms for the young generation garbage collection. The second one (UseParNewGC) gets activated automatically with the concurrent tenured generation garbage collection (see Java Concurrent and Parallel GC) but, is there a difference between the two parallel algorithms? ...

Java stack overflow error - how to increase the stack size in Eclipse?

I am running a program that I've written in Java in Eclipse. The program has a very deep level of recursion for very large inputs. For smaller inputs the program runs fine however when large inputs are given, I get the following error: Exception in thread "main" java.lang.StackOverflowError Can this be solved by increasing the Java st...

Java -classpath option

Will the use of -classpath option with java, add to or replace the contents of the CLASSPATH env variable? ...

creating a JVM from within a JNI method

Is it possible to create a JVM from within a JNI method using the JNI API? I've tried to do this using the JNI function "JNI_CreateJavaVM()", but it's not working (the function keeps returning a value less than zero). Here is the basic code I'm using (C++): JNIEnv *env; JavaVM *jvm; jint res; #ifdef JNI_VERSION_1_2 JavaVMInitArgs vm_...

Java -server argument

Possible Duplicate: Real differences between java -server and java -client? I've seen the argument "-server" used as a command line argument for java.exe: java.exe -server MyClass but no matter how hard I searched the internet I found no documentation as to what exactly it does. Can anyone explain? ...

How to give more memory to IntelliJ Idea 9

I am using IntelliJ IDEA 9. In the IDEA window On the bottom right corner I see the current memory usage, typically "224M of 254M" How do I give more memory to Idea so it may read like "224M of 512M" ? Thank you. ...

Setting jvmargs in log4j.properties file

Hey This is a bit of a weird request but I am trying to set some jvmargs in the log4j.properties file. At present I use ant to for example set some args.... jvmarg value="-Dmail.smtp.socketFactory.port=465" ... but it would be great to group a few of these logging relevant arguments into the .properties file. Does anyone know how to d...