from space and to space size is different and varies
Charlie Hunt
chunt at salesforce.com
Fri Oct 26 06:13:55 PDT 2012
Hi Thomas,
If you monitor your Java app with VisualVM's VisualGC plugin you can observe the behavior. You can launch VisualVM via jvisualvm. It's in the JDKs bin dir. Then go to the Update Center to get the VisualGC plugin.
If you run your Java app with -XX:+UseParallelGC (you don't need to specify -XX:+UseAdaptiveSizePolicy, it is enabled by default), you should see s to/from spaces sized differently on VisualGC.
Then, if you disable adaptive sizing, note the '-' character after the -XX:, via -XX:-UseAdaptiveSizePolicy, you should see that to/from spaces are staying the same size.
I will double check as well. What I just described is what I would expect to see.
Changing to/from sizes is by design with adaptive sizing enabled.
Charlie
Sent from my iPhone
On Oct 26, 2012, at 3:34 AM, "Thomas Rohde" <tro at ordix.de> wrote:
> Hi Charlie,
>
> thanks for your reply. I could reproduce this with
> -XX:+UseAdaptiveSizePolicy and Java 1.7.
>
> My misbelief that from space and to space are always the same size.
> Thought that -XX:+UseAdaptiveSizePolicy would change both of them in the
> same manner.
>
> Thanks!
> Thomas
>
>
> Am 25.10.2012 14:23, schrieb Charlie Hunt:
>> Hi Thomas,
>>
>> It is common for Parallel GC, and Parallel Old GC to adjust survivor sizes when -XX:+UseAdaptiveSizePolicy is enabled. And, -XX:+UseAdaptiveSizePolicy is enabled by default with either -XX:+UseParallelGC and -XX:+UseParallelOldGC, (iirc, the latter is not available in a Java 5 HotSpot VM).
>>
>> If you disable adaptive size policy, via -XX:-UseAdaptiveSizePolicy, survivor sizes should remain the same size.
>>
>> hths,
>>
>> charlie ...
>>
>> On Oct 25, 2012, at 3:47 AM, Thomas Rohde wrote:
>>
>>> Hi Folks,
>>>
>>> up to yesterday I always thought, that from-space and to-space have
>>> always the same size. In a GC log of a colleague I saw the following and
>>> was wondering about it:
>>>
>>> 22.10.2012 00:01:59 {Heap before gc invocations=590:
>>> 22.10.2012 00:01:59 PSYoungGen total 72768K, used 70928K
>>> [0xcdc00000, 0xd3800000, 0xf8800000)
>>> 22.10.2012 00:01:59 eden space 54528K, 100% used
>>> [0xcdc00000,0xd1140000,0xd1140000)
>>> 22.10.2012 00:01:59 from space 18240K, 89% used
>>> [0xd1460000,0xd2464168,0xd2630000)
>>> 22.10.2012 00:01:59 to space 18048K, 0% used
>>> [0xd2660000,0xd2660000,0xd3800000)
>>> 22.10.2012 00:01:59 PSOldGen total 1400832K, used 334889K
>>> [0x78400000, 0xcdc00000, 0xcdc00000)
>>> 22.10.2012 00:01:59 object space 1400832K, 23% used
>>> [0x78400000,0x8cb0a778,0xcdc00000)
>>> 22.10.2012 00:01:59 PSPermGen total 20480K, used 19997K
>>> [0x74400000, 0x75800000, 0x78400000)
>>> 22.10.2012 00:01:59 object space 20480K, 97% used
>>> [0x74400000,0x75787568,0x75800000)
>>> 22.10.2012 00:01:59 299113.923: [GC [PSYoungGen: 70928K->15357K(72512K)]
>>> 405818K->350331K(1473344K), 0.0717791 secs]
>>> 22.10.2012 00:01:59 Heap after gc invocations=590:
>>> 22.10.2012 00:01:59 PSYoungGen total 72512K, used 15357K
>>> [0xcdc00000, 0xd3800000, 0xf8800000)
>>> 22.10.2012 00:01:59 eden space 54464K, 0% used
>>> [0xcdc00000,0xcdc00000,0xd1130000)
>>> 22.10.2012 00:01:59 from space 18048K, 85% used
>>> [0xd2660000,0xd355f7d8,0xd3800000)
>>> 22.10.2012 00:01:59 to space 18112K, 0% used
>>> [0xd14a0000,0xd14a0000,0xd2650000)
>>> 22.10.2012 00:01:59 PSOldGen total 1400832K, used 334973K
>>> [0x78400000, 0xcdc00000, 0xcdc00000)
>>> 22.10.2012 00:01:59 object space 1400832K, 23% used
>>> [0x78400000,0x8cb1f778,0xcdc00000)
>>> 22.10.2012 00:01:59 PSPermGen total 20480K, used 19997K
>>> [0x74400000, 0x75800000, 0x78400000)
>>> 22.10.2012 00:01:59 object space 20480K, 97% used
>>> [0x74400000,0x75787568,0x75800000)
>>> 22.10.2012 00:01:59 }
>>>
>>> Before GC from space has 18240K and to space has 18048K.
>>> After GC from space has 18048K and to space has 18112K.
>>>
>>> java version "1.5.0_20"
>>> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_20-b02)
>>> Java HotSpot(TM) Server VM (build 1.5.0_20-b02, mixed mode)
>>>
>>> 1. Why is the size of from space and to space not equal?
>>> 2. Why is the size always changing?
>>>
>>> Bye,
>>> Thomas
>>> _______________________________________________
>>> hotspot-gc-use mailing list
>>> hotspot-gc-use at openjdk.java.net
>>> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>
>
> --
> Dipl.-Wirt. Inf. (FH)
> Thomas Rohde
> Senior Consultant
> Architekturberatung
>
> ORDIX AG
> Westernmauer 12 - 16
> 33098 Paderborn
>
> Tel: 05251 / 1063-0
> Mobil: 0163 / 6734966
> Fax: 0180 / 1673490
> mailto:tro at ordix.de
> http://www.ordix.de
>
> ORDIX AG - Aktiengesellschaft für Softwareentwicklung, Schulung,
> Beratung und Systemintegration
> Vorsitzender des Aufsichtsrates: Prof. Dr. Hermann Johannes
> Vorstand: Wolfgang Kögler (Vorsitzender), Benedikt Georgi, Christoph
> Lafeld, Axel Röber
> Firmensitz: Westernmauer 12 - 16, 33098 Paderborn, Tel: 05251 / 1063-0,
> Fax: 0180 / 1 67 34 90
> Amtsgericht Paderborn, HRB 2941, Ust-IdNr.DE 126333767, Steuernummer:
> 339/5866/0142
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
More information about the hotspot-gc-use
mailing list