[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-hotspot-gc-dev
Subject: RFR JDK-8059092: Store Interned Strings in CDS Archives
From: Jiangli Zhou <jiangli.zhou () oracle ! com>
Date: 2015-05-29 19:39:27
Message-ID: 950E7237-1EBC-4C22-8D41-701BDE7ABBC3 () oracle ! com
[Download RAW message or body]
Greetings,
Please review the changes for supporting interned String objects and the underling \
character arrays in the CDS shared archive. The webrevs listed below only include the \
runtime changes. The webrev for GC specific changes will be sent out by Tom Benson \
shortly.
JEP
https://bugs.openjdk.java.net/browse/JDK-8059092
Webrev
hotspot : http://cr.openjdk.java.net/~jiangli/8059092/webrev_hotspot.01/index.html
whitebox: http://cr.openjdk.java.net/~jiangli/8059092/webrev_wb.01/index.html
Summary
The shared strings support is added on top of the basic CDS function that enables the \
archiving of the interned String objects and String’s underlying ‘value' array \
objects from the java heap. During CDS dump time, all Strings referenced from the \
string table is copied into a special region in java heap, which is at the top of the \
dump time java heap. The special region is referred as the string space. While \
copying the String related objets, a compact table is created for storing the \
references to the copied Strings. Both the compact table and the string space are \
written into the CDS archive with the rest of the class metadata during dumping. The \
compact table for shared strings uses the same format as the shared symbol table in \
CDS archive and shares implementations.
At runtime, the string space is mapped at the same offset from the narrow oop \
encoding base as dump time within the java heap. That allows the shared strings to be \
‘partially’ relocatable, which means the runtime java heap could be at different \
address location and have different size from the dump time java heap as long as the \
same narrow oop encoding can be used. If the narrow oop encoding changes due to the \
large difference between the dump-time and runtime heap sizes, the shared string \
space from the CDS archive is ignored and not mapped to the VM address space.
The mapped string space is an ‘archive’ region in the java heap. All shared objects \
residing within the region are not collected or forwarded by GC. GC activities never \
write to the memory pages that are mapped as the shared string space. The identity \
hash of shared objects in the string space are pre-computed during CDS archive dump \
time. The only possible ‘write’ to the shared string space at runtime is from \
synchronization on the shared objects. That allows majority or all mapped string \
memory to be sharable between different VM processes.
Only 64-bit process is supported for shared strings due to the dependency on the \
narrow oop support. Windows is not supported currently.
Performance Results
Memory
Tested using about 3M of string data for memory measurement. Memory results were \
measured using linux ps_mem tool. No Shared String
Private + Shared = RAM used Program Saving
28.0 MiB + 110.5 KiB = 28.1 MiB java
31.5 MiB + 12.6 MiB = 44.2 MiB java (2)
47.2 MiB + 12.7 MiB = 59.9 MiB java (3)
63.2 MiB + 12.8 MiB = 76.1 MiB java (4)
78.0 MiB + 12.9 MiB = 90.8 MiB java (5)
With Shared String
27.6 MiB + 111.5 KiB = 27.7 MiB java 0.4M
23.7 MiB + 16.3 MiB = 40.0 MiB java (2) 4.2M
35.3 MiB + 16.4 MiB = 51.7 MiB java (3) 8.2M
48.3 MiB + 16.5 MiB = 64.8 MiB java (4) 11.3M
60.6 MiB+ 16.5 MiB= 77.2MiB java(5) 13.6M
Runtime Performance
Tested on isolated linux-x64 machine.
SpecJVM98
==============================================================================
logs.specjvm.before2:
Benchmark Samples Mean Stdev Geomean Weight
specjvm98 10 603.39 23.25
==============================================================================
logs.specjvm.after2:
Benchmark Samples Mean Stdev %Diff P Significant
specjvm98 10 604.89 10.85 0.25 0.856 *
==============================================================================
No performance degradation shown in specjvm.
Testing
Tested with:
Developed unit tests
JPRT
Full QA test cycle: vm.gc, vm.runtime, nsk.sysdict, vm.metaspace, vm.quick, JCK: vm, \
lang, api, KS-24hrs, runThese Thanks,
Jiangli
[Attachment #3 (unknown)]
<html><head><meta http-equiv="Content-Type" content="text/html \
charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space;">Greetings,<div><br></div><div>Please \
review the changes for supporting interned String objects and the underling character \
arrays in the CDS shared archive. The webrevs listed below only include the runtime \
changes. The webrev for GC specific changes will be sent out by Tom Benson \
shortly.</div><div><br></div><div><b>JEP</b></div><div><a \
href="https://bugs.openjdk.java.net/browse/JDK-8059092">https://bugs.openjdk.java.net/browse/JDK-8059092</a></div><div><br></div><div><b>Webrev</b></div><div>hotspot \
: <a href="http://cr.openjdk.java.net/~jiangli/8059092/webrev_hotspot.01/index.h \
tml">http://cr.openjdk.java.net/~jiangli/8059092/webrev_hotspot.01/index.html</a></div><div>whitebox: <a \
href="http://cr.openjdk.java.net/~jiangli/8059092/webrev_wb.01/index.html">http://cr.o \
penjdk.java.net/~jiangli/8059092/webrev_wb.01/index.html</a></div><div><br></div><div><div><b>Summary</b></div><div>The \
shared strings support is added on top of the basic CDS function that enables the \
archiving of the interned String objects and String’s underlying ‘value' array \
objects from the java heap. During CDS dump time, all Strings referenced from the \
string table is copied into a special region in java heap, which is at the top of the \
dump time java heap. The special region is referred as the string space. While \
copying the String related objets, a compact table is created for storing the \
references to the copied Strings. Both the compact table and the string space are \
written into the CDS archive with the rest of the class metadata during dumping. The \
compact table for shared strings uses the same format as the shared symbol table in \
CDS archive and shares implementations.</div><div><br></div><div>At runtime, the \
string space is mapped at the same offset from the narrow oop encoding base as dump \
time within the java heap. That allows the shared strings to be ‘partially’ \
relocatable, which means the runtime java heap could be at different address location \
and have different size from the dump time java heap as long as the same narrow oop \
encoding can be used. If the narrow oop encoding changes due to the large difference \
between the dump-time and runtime heap sizes, the shared string space from the CDS \
archive is ignored and not mapped to the VM address \
space. </div><div><br></div><div>The mapped string space is an ‘archive’ region \
in the java heap. All shared objects residing within the region are not collected or \
forwarded by GC. GC activities never write to the memory pages that are mapped as the \
shared string space. The identity hash of shared objects in the string space are \
pre-computed during CDS archive dump time. The only possible ‘write’ to the shared \
string space at runtime is from synchronization on the shared objects. That allows \
majority or all mapped string memory to be sharable between different VM \
processes. </div><div><br></div><div>Only 64-bit process is supported for shared \
strings due to the dependency on the narrow oop support. Windows is not supported \
currently.</div><div><br></div></div><div><b>Performance \
Results</b></div><div><div><b>Memory</b></div><div><div>Tested using about 3M of \
string data for memory measurement. Memory results were measured using linux ps_mem \
tool.</div></div></div><div><div><b>No Shared String</b></div><div><div \
style="margin: 0px;"> Private + Shared = RAM \
used<span class="Apple-tab-span" style="white-space: pre;"> </span>Program \
Saving</div></div><div><div style="margin: 0px;"><div style="margin: 0px;"><div \
style="margin: 0px;"><div style="margin: 0px;"><div style="margin: 0px;"><div \
style="margin: 0px;"><div style="margin: 0px;"> 28.0 MiB + 110.5 KiB \
= 28.1 MiB<span class="Apple-tab-span" style="white-space: \
pre;"> </span>java</div><div style="margin: 0px;"><div style="margin: \
0px;"> 31.5 MiB + 12.6 MiB = 44.2 MiB<span \
class="Apple-tab-span" style="white-space: pre;"> </span>java (2)</div><div \
style="margin: 0px;"><div style="margin: 0px;"> 47.2 MiB + 12.7 MiB \
= 59.9 MiB<span class="Apple-tab-span" style="white-space: \
pre;"> </span>java (3)</div><div style="margin: 0px;"><div style="margin: \
0px;"> 63.2 MiB + 12.8 MiB = 76.1 MiB<span \
class="Apple-tab-span" style="white-space: pre;"> </span>java (4)</div><div \
style="margin: 0px;"><div style="margin: 0px;"> 78.0 MiB + 12.9 MiB \
= 90.8 MiB<span class="Apple-tab-span" style="white-space: \
pre;"> </span>java (5)</div><div style="margin: 0px;"><br></div><div style="margin: \
0px;"><b>With Shared String</b></div><div style="margin: 0px;"><div style="margin: \
0px;"> 27.6 MiB + 111.5 KiB = 27.7 MiB<span class="Apple-tab-span" \
style="white-space: pre;"> </span>java \
<b>0.4M</b></div><div style="margin: 0px;"><div style="margin: \
0px;"> 23.7 MiB + 16.3 MiB = 40.0 MiB<span \
class="Apple-tab-span" style="white-space: pre;"> </span>java (2) \
<b>4.2M</b></div><div style="margin: 0px;"><div style="margin: 0px;"> 35.3 \
MiB + 16.4 MiB = 51.7 MiB<span class="Apple-tab-span" \
style="white-space: pre;"> </span>java (3) <b>8.2M</b></div><div \
style="margin: 0px;"><div style="margin: 0px;"> 48.3 MiB + 16.5 MiB \
= 64.8 MiB<span class="Apple-tab-span" style="white-space: \
pre;"> </span>java (4) <b> 11.3M</b></div><div style="margin: \
0px;"><div style="font-family: Menlo; font-size: 11px; margin: 0px;">60.6 MiB+ 16.5 \
MiB= 77.2MiB java(5) <b>13.6M</b></div><div style="font-family: Menlo; \
font-size: 11px; margin: 0px;"><b><br></b></div><div style="margin: \
0px;"><div><b><font>Runtime Performance</font></b></div><div><font>Tested on isolated \
linux-x64 machine.</font></div><div style="font-family: \
Helvetica;"><b>SpecJVM98</b></div><div style="font-size: 12px; font-family: \
Helvetica;"><div style="margin: 0px; font-size: 11px; font-family: \
Menlo;">==============================================================================</div><div \
style="margin: 0px; font-size: 11px; font-family: \
Menlo;">logs.specjvm.before2:</div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo;"> Benchmark \
Samples Mean Stdev \
Geomean Weight</div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo;"> specjvm98 \
10 603.39 23.25 \
</div><div style="margin: 0px; font-size: 11px; font-family: \
Menlo;">==============================================================================</div><div \
style="margin: 0px; font-size: 11px; font-family: \
Menlo;">logs.specjvm.after2:</div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo;"> Benchmark \
Samples Mean Stdev %Diff \
P Significant</div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo;"> specjvm98 \
10 604.89 10.85 0.25 \
0.856 *</div><div style="margin: 0px; \
font-size: 11px; font-family: \
Menlo;">==============================================================================</div><div><br></div><div>No \
performance degradation shown in \
specjvm.</div><div><br></div><div><b>Testing</b></div><div>Tested \
with:</div><div><ul><li>Developed unit tests</li><li>JPRT</li><li>Full QA test \
cycle: <span style="background-color: rgb(255, 255, 255); color: rgb(51, 51, \
51); font-family: Arial, sans-serif; font-size: 14px; line-height: 20px;">vm.gc, \
vm.runtime,</span><span style="background-color: rgb(255, 255, 255); color: rgb(51, \
51, 51); font-family: Arial, sans-serif; font-size: 14px; line-height: \
20px;"> </span><span style="background-color: rgb(255, 255, 255); color: rgb(51, \
51, 51); font-family: Arial, sans-serif; font-size: 14px; line-height: \
20px;">nsk.sysdict, </span><span style="background-color: rgb(255, 255, 255); \
color: rgb(51, 51, 51); font-family: Arial, sans-serif; font-size: 14px; line-height: \
20px;">vm.metaspace, </span><span style="background-color: rgb(255, 255, 255); \
color: rgb(51, 51, 51); font-family: Arial, sans-serif; font-size: 14px; line-height: \
20px;">vm.quick, </span><span style="background-color: rgb(255, 255, 255); \
color: rgb(51, 51, 51); font-family: Arial, sans-serif; font-size: 14px; line-height: \
20px;">JCK: vm, lang, api, </span><span style="background-color: rgb(255, 255, \
255); color: rgb(51, 51, 51); font-family: Arial, sans-serif; font-size: 14px; \
line-height: 20px;">KS-24hrs, \
runThese</span></li></ul></div><div>Thanks,</div><div>Jiangli</div><div><br></div></di \
v></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic