jvm-arguments

Java 8 with Jetty on linux memory issue

醉酒当歌 提交于 2019-11-30 07:39:20
Can you please help me resolving the following issue: Context: We are trying to migrate our existing application which is currently running on Java6( on Glassfish) in production to Java8 (on Jetty9) setup. Earlier, We were able to successfully migrate the same setup on Java7(on jetty9). But the customer has decided to go with Java 8 now. In this process we have encountered some memory issues and below are the details: Problem Description: After starting the Jetty server, initial (RES)memory usage of java process is around 5.5g. After running the application for sometime the memory usage slowly

Java 8 reserves minimum 1G for Metaspace despite (Max)MetaspaceSize

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 21:07:51
Java 8 reserves 1G for Metaspace just after it starts. It means that minimum metaspace size is 1G. But I set up MetaspaceSize to 300m and MaxMetaspaceSize to 400m. Why Java reserves more then I allow? Java Version $ java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) VM Flags $ jcmd 21689 VM.flags 21689: -XX:CICompilerCount=3 -XX:ConcGCThreads=1 -XX:G1HeapRegionSize=1048576 -XX:InitialHeapSize=62914560 -XX:+ManagementServer -XX:MarkStackSize=4194304 -XX:MaxHeapSize=1006632960 -XX

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

老子叫甜甜 提交于 2019-11-29 18:40:59
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? fglez After a lot of searching, the best explanation I've found is from Java Performance Tuning website in Question of the month: 1.4.1 Garbage collection algorithms, January 29th, 2003 Young generation garbage collection algorithms The (original) copying collector (Enabled by default). When this collector kicks in

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

别等时光非礼了梦想. 提交于 2019-11-29 17:23:05
问题 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); 回答1: The first day of the week is derived from the current locale. If you don't set the locale of the calendar (Calendar.getInstance(Locale), or new GregorianCalendar(Locale)), it will use the system's default. The system's default can be overridden by a JVM parameter:

NewRatio parameter not working with CMS garbage collector

丶灬走出姿态 提交于 2019-11-29 14:55:45
I switched to CMS collector for my application and throughput of application decreased by half. From GC logs, I see a high frequency of minor GCs happening (aroung 10 per second ). I have allocated a heap size of 4G . The JVM be default is using very small size for young gen (less than 40MB ). I want to try out CMS via increasing the size of young gen. Can you point me to right JVM parameter for this. I tried -XX:NewRatio but JVM ignored this parameter and there was no change in young gen sizes My java version is java version "1.6.0_14" How did you set -XX:NewRatio , and on which JVM version?

XX:+HeapDumpOnOutOfMemoryError Max file size limit

回眸只為那壹抹淺笑 提交于 2019-11-29 10:59:26
I'm running a Java process with the XX:+HeapDumpOnOutOfMemoryError JVM flag and seeing the following output: java.lang.OutOfMemoryError: Java heap space Dumping heap to /local/disk2/heaps/heapdump.hprof ... Dump file is incomplete: file size limit Is there a way to get around this issue? The -XX:+HeapDumpOnOutOfMemoryError command-line option tells the HotSpot VM to generate a heap dump when an allocation from the Java heap or the permanent generation cannot be satisfied. There is no overhead in running with this option, and so it can be useful for production systems where OutOfMemoryError

Java -classpath option

ⅰ亾dé卋堺 提交于 2019-11-29 06:06:41
问题 Will the use of -classpath option with java , add to or replace the contents of the CLASSPATH env variable? 回答1: Using the classpath variable it overrides the CLASSPATH of Environment variable but only for that session. If you restart the application you need to again set the classpath variable. 回答2: Yes. Quoted from the java(1) man page: -classpath classpath -cp classpath Specifies a list of directories, JAR archives, and ZIP archives to search for class files. Class path entries are

Could not initialize class sun.awt.X11GraphicsEnvironment on Solaris

我与影子孤独终老i 提交于 2019-11-29 01:23:47
I am running into this error while running my installer on a Solaris machine: Installing... ------------- [==================|==================|==================|==================] [---Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX) Stack Trace: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102) at java.awt.GraphicsEnvironment

JVM -XX:+StringCache argument?

与世无争的帅哥 提交于 2019-11-29 01:19:30
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 was not creating new objects, but pulling them from this pool. Has anyone ever used this argument, or can explain why it would be needed? EDIT: I attempted to run a benchmark, to see if this argument had any effect and was unable to get the Sun JVM to recognize it.

Run Java console app as a daemon (background)

人盡茶涼 提交于 2019-11-28 20:54:49
I've developed a Java console application that when start, open a console window and remain in foreground, i want to start that application in background . Now i launch the application by this command line : java -jar myapp.jar Is there a way to achieve this behaviour ? It's enough change the command line parameter or i need to do some change on my code ? The answer is operating system dependent. *nix: <your command> & Windows: (opens a new console): start <your command> Windows: (doesn't open a new console): start /b <your command> If you are doing this in anything unix based then you can