jvm-hotspot

-XX:MaxPermSize with or without -XX:PermSize

守給你的承諾、 提交于 2019-11-26 11:59:20
问题 We\'ve run into a Java.lang.OutOfMemoryError: PermGen space error and looking at the tomcat JVM params, other than the -Xms and -Xmx params we also specify -XX:MaxPermSize=128m . After a bit of profiling I can see occasionally garbage collection happening on the PermGen space saving it from running full. My question is: other than increasing the -XX:MaxPermSize what would be the difference if I specify as well -XX:PermSize ? I know the total memory then would be Xmx+maxPermSize but is there

What are ReservedCodeCacheSize and InitialCodeCacheSize?

不羁的心 提交于 2019-11-26 10:21:20
问题 Can someone please explain what the JVM option ReservedCodeCacheSize and InitialCodeCacheSize are? Specifically when/why would I want to change it? How do I decide what the right size is? This is what the docs say: -XX:ReservedCodeCacheSize=32m Reserved code cache size (in bytes) - maximum code cache size. [Solaris 64-bit, amd64, and -server x86: 2048m; in 1.5.0_06 and earlier, Solaris 64-bit and and64: 1024m.] 回答1: ReservedCodeCacheSize (and InitialCodeCacheSize ) is an option for the (just

Java Exceptions counter on JVM HotSpot

旧巷老猫 提交于 2019-11-26 08:23:26
问题 I am wondering is it possible to log every exception which occurs on JVM level without changing application code? By every exception I mean caught and uncaught exception... I would like to analyze those logs later and group them by exception type (class) and simply count exceptions by type. I am using HotSpot ;) Maybe there is smarter why of doing it? For example by any free profiler (YourKit has it but it is not free)? I think that JRockit has exception counter in management console, but don

Analyzing gc logs

二次信任 提交于 2019-11-26 07:44:06
问题 I am using -XX:+PrintGCApplicationStoppedTime and -XX:+PrintGCApplicationConcurrentTime options to turn on gc logging. But found that only after 4 0r 5 prints of PrintGCApplicationStoppedTime my actual details of gc logs printed through -XX:+PrintGCDetails command! By definition PrintGCApplicationStoppedTime prints application stopped time for every gc. But I am not clear why it prints like the example shown below. Is that because PrintGCApplicationStoppedTime just prints after every safe

Class JavaLaunchHelper is implemented in both … libinstrument.dylib. One of the two will be used. Which one is undefined

自古美人都是妖i 提交于 2019-11-26 03:02:37
问题 I upgraded to the latest Java 7u40 on MacOS X and started getting the following message on the console when launching my application using Eclipse. The app works fine but I would like to find out the cause of the problem and hopefully a fix for it. objc[10012]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will

Running jmap getting Unable to open socket file

白昼怎懂夜的黑 提交于 2019-11-26 01:57:32
问题 I had to run jmap in order to take heap dump of my process. but jvm returned: Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding So I used the -F : ./jmap -F -dump:format=b,file=heap.bin 10330 Attaching to process ID 10331, please wait... Debugger attached successfully. Server compiler detected. JVM version is 24.51-b03 Dumping heap to heap.bin ... Using -F is allright for taking heap dump? I

Running jmap getting Unable to open socket file

可紊 提交于 2019-11-26 00:42:47
I had to run jmap in order to take heap dump of my process. but jvm returned: Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding So I used the -F : ./jmap -F -dump:format=b,file=heap.bin 10330 Attaching to process ID 10331, please wait... Debugger attached successfully. Server compiler detected. JVM version is 24.51-b03 Dumping heap to heap.bin ... Using -F is allright for taking heap dump? I am waiting 20 minutes and not finished yet. Any ideas why? apangin jmap vs. jmap -F , as well as jstack

Real differences between “java -server” and “java -client”?

烂漫一生 提交于 2019-11-25 22:35:28
问题 Is there any real practical difference between \"java -server\" and \"java -client\"? All I can find on Sun\'s site is a vague \"-server starts slower but should run faster\". What are the real differences? (Using JDK 1.6.0_07 currently.) 回答1: This is really linked to HotSpot and the default option values (Java HotSpot VM Options) which differ between client and server configuration. From Chapter 2 of the whitepaper (The Java HotSpot Performance Engine Architecture): The JDK includes two

How do I write a correct micro-benchmark in Java?

天大地大妈咪最大 提交于 2019-11-25 22:09:21
问题 How do you write (and run) a correct micro-benchmark in Java? I\'m looking for some code samples and comments illustrating various things to think about. Example: Should the benchmark measure time/iteration or iterations/time, and why? Related: Is stopwatch benchmarking acceptable? 回答1: Tips about writing micro benchmarks from the creators of Java HotSpot: Rule 0: Read a reputable paper on JVMs and micro-benchmarking. A good one is Brian Goetz, 2005. Do not expect too much from micro