g1gc

Does G1 GC have a max size of region or max amount of region?

蓝咒 提交于 2019-12-01 20:32:37
when i studied G1 GC, I found this article: http://www.oracle.com/technetwork/articles/java/g1gc-1984535.html . In that article, there is something says as follow: The G1 GC is a regionalized and generational garbage collector, which means that the Java object heap (heap) is divided into a number of equally sized regions. Upon startup, the Java Virtual Machine (JVM) sets the region size. The region sizes can vary from 1 MB to 32 MB depending on the heap size. The goal is to have no more than 2048 regions. Does that mean the max size of java heap memory that G1 GC can deal with is 2048 * 32M,

G1GC remark phase is taking too long

假装没事ソ 提交于 2019-12-01 19:42:08
My server application under load some times goes unresponsive and i found the issue to be related to very long "GC Remark". There is no garbage collection tuning implemented. My test server is a 4 core/8 gb/8 GB swap. This is the log output from gc logs. 2014-04-06T04:39:58.426+0530: 67263.405: [GC remark, 46.7308340 secs] 2014-04-06T04:40:45.167+0530: 67310.146: [GC cleanup 1951M->1750M(2954M), 0.0037930 secs] 2014-04-06T04:40:45.174+0530: 67310.153: [GC concurrent-cleanup-start] 2014-04-06T04:40:45.175+0530: 67310.154: [GC concurrent-cleanup-end, 0.0002800 secs] 2014-04-06T04:40:45.633+0530:

How do I get G1 to print more log details?

跟風遠走 提交于 2019-12-01 14:09:33
I'm testing a Jetty-based API vs a Netty-based one. With the only difference in the experiment being which API I use (same application, same servers, same memory config, same load etc. etc.), I get longer GC pauses with the Netty-based one. Mostly, pauses are below a millisecond, but after a few days of running smoothly, every 12-24hours I'll see a 4-6 second pause that does not show up with the Jetty-based API. Whenever this happens, there is extremely little information about what G1 was doing that caused it to issue a STW, note the second pause message here: 2016-02-23T05:22:27.709+0000:

How do I get G1 to print more log details?

不打扰是莪最后的温柔 提交于 2019-12-01 09:58:08
问题 I'm testing a Jetty-based API vs a Netty-based one. With the only difference in the experiment being which API I use (same application, same servers, same memory config, same load etc. etc.), I get longer GC pauses with the Netty-based one. Mostly, pauses are below a millisecond, but after a few days of running smoothly, every 12-24hours I'll see a 4-6 second pause that does not show up with the Jetty-based API. Whenever this happens, there is extremely little information about what G1 was

Why is the Java G1 gc spending so much time scanning RS?

独自空忆成欢 提交于 2019-11-30 20:53:45
I'm currently evaluating the G1 garbage collector and how it performs for our application. Looking at the gc-log, I noticed a lot of collections have very long "Scan RS" phases: 7968.869: [GC pause (mixed), 10.27831700 secs] [Parallel Time: 10080.8 ms] (...) [Scan RS (ms): 4030.4 4034.1 4032.0 4032.0 Avg: 4032.1, Min: 4030.4, Max: 4034.1, Diff: 3.7] [Object Copy (ms): 6038.5 6033.3 6036.7 6037.1 Avg: 6036.4, Min: 6033.3, Max: 6038.5, Diff: 5.2] (...) [Eden: 19680M(19680M)->0B(20512M) Survivors: 2688M->2624M Heap: 75331M(111904M)->51633M(115744M)] [Times: user=40.49 sys=0.02, real=10.28 secs]

Is String Deduplication feature of the G1 garbage collector enabled by default?

两盒软妹~` 提交于 2019-11-30 08:33:53
JEP 192: String Deduplication in G1 implemented in Java 8 Update 20 added the new String deduplication feature: Reduce the Java heap live-data set by enhancing the G1 garbage collector so that duplicate instances of String are automatically and continuously deduplicated. The JEP page mentions that a command-line option UseStringDeduplication (bool) allows the dedup feature to be enabled or disabled. But the JEP page does not go so far as to indicate the default. ➠ Is the dedup feature ON or OFF by default in the G1 garbage collector bundled with Java 8 and with Java 9? ➠ Is there a “getter”

How can I tune G1GC for smaller memory footprint?

你离开我真会死。 提交于 2019-11-30 07:54:58
I have been experimenting with G1GC with Java 8 (Oracle JVM) on one of my projects. My GC flags are effectively: -Xms64m -Xmx1024m -XX:+UseG1GC -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:/tmp/gc.log -XX:+PrintAdaptiveSizePolicy I observe that the heap grows much larger than the amount of live data I have. The GC logs show what I think is the root cause: [G1Ergonomics (Heap Sizing) attempt heap expansion, reason: recent GC overhead higher than threshold after GC, recent GC overhead: 10.17 %, threshold: 10.00 %, uncommitted: 811597824 bytes, calculated expansion amount: 162319564 bytes

Is -XX:+UseG1GC the correct replacement for -Xincgc?

牧云@^-^@ 提交于 2019-11-29 04:05:22
Currently, we are using the incremental garbage collector by adding -Xincgc to the java command. In JDK 8 this switch is deprecated. So what's the equivalent replacement for it? -XX:+UseG1GC ? Background: The application has a heap of 8GB and creates a lot of short living objects. I noticed that it often paused for some seconds to do garbage collection. Out of curiosity I added the -Xincgc and found that the pauses were gone and overall performance improved ~4 times. Unfortunately, I did not find any information about what type of garbage collector the -Xincgc triggers. There's the CMS

Zero-garbage large String deserialization in Java, Humongous object issue

心不动则不痛 提交于 2019-11-29 00:08:36
I am looking for a way to deserialize a String from a byte[] in Java with as little garbage produced as possible. Because I am creating my own serializer and de-serializer, I have complete freedom to implement any solution on the server-side (i.e. when serializing data), and on the client-side (i.e. when de-serializing data). I have managed to efficiently serialize a String without incurring any garbage overhead by iterating through the String's chars ( String.charAt(i) ) and converting each char (16-bit value) to 2x 8-bit value. There is a nice debate regarding this here . An alternative is

Can someone make sense of the G1 garbage collector output?

一世执手 提交于 2019-11-28 17:37:08
I am running a Java program with the G1 garbage collector using the following options: -XX:-UseBiasedLocking -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:/var/tmp/gclog.out The output looks like this... 44900.297: [GC pause (young)44900.386 (initial-mark), 0.08894851 secs] : [GC concurrent-mark-start] [Parallel Time: 83.7 ms] [GC Worker Start Time (ms): 44900297.6 44900297.6 44900297.6 44900297.6 44900297.6 44900297.7 44900297.7 44900297.7 44900297.7 44900297.7 44900297.7 44900297.7 44900297.7 Avg: 44900297.7, Min: 44900297.6, Max