Quantcast

RFR: 8166191: Missing spaces in log message

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RFR: 8166191: Missing spaces in log message

chihiro ito
Hi all,

Could I have a reviews for this fix, please? This patch add spaces
following each ":" like a JDK 8 log in log message.

Log message that ran JDK 9 with -Xlog:gc+ergo+heap=debug option is
following.
[0.019s][debug][gc,ergo,heap] Expand the heap. requested expansion
amount: 10485760B expansion amount: 10485760B

Log message that ran JDK 8 with -XX:+PrintAdaptiveSizePolicy option is
following.
0.124: [G1Ergonomics (Heap Sizing) expand the heap, requested expansion
amount: 10485760 bytes, attempted expansion amount: 10485760 bytes]

Bug:
Missing spaces in log message
https://bugs.openjdk.java.net/browse/JDK-8166191


diff --git a/src/share/vm/gc/g1/g1CollectedHeap.cpp
b/src/share/vm/gc/g1/g1CollectedHeap.cpp
--- a/src/share/vm/gc/g1/g1CollectedHeap.cpp
+++ b/src/share/vm/gc/g1/g1CollectedHeap.cpp
@@ -1615,7 +1615,7 @@
    aligned_expand_bytes = align_size_up(aligned_expand_bytes,
                                         HeapRegion::GrainBytes);

-  log_debug(gc, ergo, heap)("Expand the heap. requested expansion
amount:" SIZE_FORMAT "B expansion amount:" SIZE_FORMAT "B",
+  log_debug(gc, ergo, heap)("Expand the heap. requested expansion
amount: " SIZE_FORMAT "B expansion amount: " SIZE_FORMAT "B",
                              expand_bytes, aligned_expand_bytes);

    if (is_maximal_no_gc()) {
diff --git a/test/gc/g1/TestGCLogMessages.java
b/test/gc/g1/TestGCLogMessages.java
--- a/test/gc/g1/TestGCLogMessages.java
+++ b/test/gc/g1/TestGCLogMessages.java
@@ -23,7 +23,7 @@

  /*
   * @test TestGCLogMessages
- * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962 8069330
8076463 8150630 8160055
+ * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962 8069330
8076463 8150630 8160055 8166191
   * @summary Ensure the output for a minor GC with G1
   * includes the expected necessary messages.
   * @key gc
@@ -131,6 +131,7 @@
          new TestGCLogMessages().testNormalLogs();
          new TestGCLogMessages().testWithToSpaceExhaustionLogs();
          new TestGCLogMessages().testWithInitialMark();
+        new TestGCLogMessages().testExpandHeap();
      }

      private void testNormalLogs() throws Exception {
@@ -205,6 +206,22 @@
          output.shouldContain("Clear Claimed Marks");
          output.shouldHaveExitValue(0);
      }
+
+    private void testExpandHeap() throws Exception {
+        ProcessBuilder pb =
ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+ "-Xmx10M",
+ "-Xbootclasspath/a:.",
+ "-Xlog:gc+ergo+heap=debug",
+ "-XX:+UnlockDiagnosticVMOptions",
+ "-XX:+WhiteBoxAPI",
+ GCTest.class.getName());
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Expand the heap. requested expansion
amount: ")
+        .shouldContain("B expansion amount: ")
+        .shouldHaveExitValue(0);
+    }
+

      static class GCTest {
          private static byte[] garbage;

Thanks,
Chihiro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR: 8166191: Missing spaces in log message

Thomas Schatzl
Hi Chihiro,

On Tue, 2017-04-11 at 03:04 +0900, chihiro ito wrote:

> Hi all,
>
> Could I have a reviews for this fix, please? This patch add spaces 
> following each ":" like a JDK 8 log in log message.
>
> Log message that ran JDK 9 with -Xlog:gc+ergo+heap=debug option is 
> following.
> [0.019s][debug][gc,ergo,heap] Expand the heap. requested expansion 
> amount: 10485760B expansion amount: 10485760B
>
> Log message that ran JDK 8 with -XX:+PrintAdaptiveSizePolicy option
> is following.
> 0.124: [G1Ergonomics (Heap Sizing) expand the heap, requested
> expansion amount: 10485760 bytes, attempted expansion amount:
> 10485760 bytes]
>
> Bug:
> Missing spaces in log message
> https://bugs.openjdk.java.net/browse/JDK-8166191

I also noticed that just a few days ago. Thanks for fixing this :)

I created a webrev from your diff at

http://cr.openjdk.java.net/~tschatzl/8166191/webrev/

Looks good. I can sponsor.

Passes jprt.

Thanks,
  Thomas

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR: 8166191: Missing spaces in log message

chihiro ito
Hi Thomas,

Thanks you for reviewing diff :)

Chihiro

On 2017/04/11 23:02, Thomas Schatzl wrote:
Hi Chihiro,

On Tue, 2017-04-11 at 03:04 +0900, chihiro ito wrote:
Hi all,

Could I have a reviews for this fix, please? This patch add spaces 
following each ":" like a JDK 8 log in log message.

Log message that ran JDK 9 with -Xlog:gc+ergo+heap=debug option is 
following.
[0.019s][debug][gc,ergo,heap] Expand the heap. requested expansion 
amount: 10485760B expansion amount: 10485760B

Log message that ran JDK 8 with -XX:+PrintAdaptiveSizePolicy option
is following.
0.124: [G1Ergonomics (Heap Sizing) expand the heap, requested
expansion amount: 10485760 bytes, attempted expansion amount:
10485760 bytes]

Bug:
Missing spaces in log message
https://bugs.openjdk.java.net/browse/JDK-8166191
I also noticed that just a few days ago. Thanks for fixing this :)

I created a webrev from your diff at

http://cr.openjdk.java.net/~tschatzl/8166191/webrev/

Looks good. I can sponsor.

Passes jprt.

Thanks,
  Thomas


--

Chihiro Ito | Principal Consultant | +81.90.6148.8815
Oracle Consultant
ORACLE Japan | Akasaka Center Bldg. | Motoakasaka 1-3-13 | 1070051 Minato-ku, Tokyo, JAPAN

Oracle is committed to developing practices and products that help protect the environment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR: 8166191: Missing spaces in log message

sangheon.kim@oracle.com
In reply to this post by Thomas Schatzl
Hi Chihiro,

On 04/11/2017 07:02 AM, Thomas Schatzl wrote:

> Hi Chihiro,
>
> On Tue, 2017-04-11 at 03:04 +0900, chihiro ito wrote:
>> Hi all,
>>
>> Could I have a reviews for this fix, please? This patch add spaces
>> following each ":" like a JDK 8 log in log message.
>>
>> Log message that ran JDK 9 with -Xlog:gc+ergo+heap=debug option is
>> following.
>> [0.019s][debug][gc,ergo,heap] Expand the heap. requested expansion
>> amount: 10485760B expansion amount: 10485760B
>>
>> Log message that ran JDK 8 with -XX:+PrintAdaptiveSizePolicy option
>> is following.
>> 0.124: [G1Ergonomics (Heap Sizing) expand the heap, requested
>> expansion amount: 10485760 bytes, attempted expansion amount:
>> 10485760 bytes]
>>
>> Bug:
>> Missing spaces in log message
>> https://bugs.openjdk.java.net/browse/JDK-8166191
> I also noticed that just a few days ago. Thanks for fixing this :)
>
> I created a webrev from your diff at
>
> http://cr.openjdk.java.net/~tschatzl/8166191/webrev/
Looks good to me too. Thank you for the patch.

Thanks,
Sangheon


>
> Looks good. I can sponsor.
>
> Passes jprt.
>
> Thanks,
>    Thomas
>

Loading...