The reason is the dump-time heap ends at 0x00000007c0000000, but the runtime heap ends at 0x0000000800000000. We should try to make both cases end at the same location (probably 0x0000000800000000).
=================
$ java -Xshare:dump -Xmx8g
$ java -Xlog:cds -Xmx8g --version
[0.014s][info][cds] trying to map /jdk3/bld/tea-debug/images/jdk/lib/server/classes.jsa
[0.014s][info][cds] Opened archive /jdk3/bld/tea-debug/images/jdk/lib/server/classes.jsa.
[0.014s][info][cds] Archive was created with UseCompressedOops = 1, UseCompressedClassPointers = 1
[0.014s][info][cds] Core region alignment: 4096
[0.014s][info][cds] Reserved archive_space_rs [0x0000000800000000 - 0x0000000801000000] (16777216) bytes
[0.014s][info][cds] Reserved class_space_rs [0x0000000801000000 - 0x0000000841000000] (1073741824) bytes
[0.014s][info][cds] Mapped static region #0 at base 0x0000000800000000 top 0x000000080050d000 (ReadWrite)
[0.014s][info][cds] Mapped static region #1 at base 0x000000080050d000 top 0x0000000800d2e000 (ReadOnly)
[0.014s][info][cds] CDS archive was created with max heap size = 8192M, and the following configuration:
[0.014s][info][cds] narrow_klass_base = 0x0000000800000000, narrow_klass_shift = 0
[0.014s][info][cds] narrow_oop_mode = 1, narrow_oop_base = 0x0000000000000000, narrow_oop_shift = 3
[0.014s][info][cds] heap range = [0x00000005c0000000 - 0x00000007c0000000]
[0.014s][info][cds] The current max heap size = 8192M, HeapRegion::GrainBytes = 4194304
[0.014s][info][cds] narrow_klass_base = 0x0000000800000000, narrow_klass_shift = 0
[0.014s][info][cds] narrow_oop_mode = 1, narrow_oop_base = 0x0000000000000000, narrow_oop_shift = 3
[0.014s][info][cds] heap range = [0x0000000600000000 - 0x0000000800000000]
[0.014s][info][cds] Preferred address to map heap data (to avoid relocation) is 0x00000007bfc00000
[0.015s][info][cds] Mapped static region #2 at base 0x00007fa21d6ab000 top 0x00007fa21d6eb000 (Bitmap)
[0.015s][info][cds] Heap data mapped at 0x00000007ffc00000, size = 1075264 bytes
[0.015s][info][cds] CDS heap data relocation delta = 1073741824 bytes
[0.015s][info][cds] optimized module handling: enabled
[0.015s][info][cds] full module graph: enabled
[0.015s][info][cds] use_full_module_graph = true; java.base = 0x0000000800507f18
[0.022s][info][cds] patching heap embedded pointers: narrowOop 0xf7f80000 -> 0xfff80000
[0.022s][info][cds] CDS heap data relocation quick delta = 0x8000000
[0.036s][info][cds] Unmapping region #2 at base 0x00007fa21d6ab000 (Bitmap)
=================
$ java -Xshare:dump -Xmx8g
$ java -Xlog:cds -Xmx8g --version
[0.014s][info][cds] trying to map /jdk3/bld/tea-debug/images/jdk/lib/server/classes.jsa
[0.014s][info][cds] Opened archive /jdk3/bld/tea-debug/images/jdk/lib/server/classes.jsa.
[0.014s][info][cds] Archive was created with UseCompressedOops = 1, UseCompressedClassPointers = 1
[0.014s][info][cds] Core region alignment: 4096
[0.014s][info][cds] Reserved archive_space_rs [0x0000000800000000 - 0x0000000801000000] (16777216) bytes
[0.014s][info][cds] Reserved class_space_rs [0x0000000801000000 - 0x0000000841000000] (1073741824) bytes
[0.014s][info][cds] Mapped static region #0 at base 0x0000000800000000 top 0x000000080050d000 (ReadWrite)
[0.014s][info][cds] Mapped static region #1 at base 0x000000080050d000 top 0x0000000800d2e000 (ReadOnly)
[0.014s][info][cds] CDS archive was created with max heap size = 8192M, and the following configuration:
[0.014s][info][cds] narrow_klass_base = 0x0000000800000000, narrow_klass_shift = 0
[0.014s][info][cds] narrow_oop_mode = 1, narrow_oop_base = 0x0000000000000000, narrow_oop_shift = 3
[0.014s][info][cds] heap range = [0x00000005c0000000 - 0x00000007c0000000]
[0.014s][info][cds] The current max heap size = 8192M, HeapRegion::GrainBytes = 4194304
[0.014s][info][cds] narrow_klass_base = 0x0000000800000000, narrow_klass_shift = 0
[0.014s][info][cds] narrow_oop_mode = 1, narrow_oop_base = 0x0000000000000000, narrow_oop_shift = 3
[0.014s][info][cds] heap range = [0x0000000600000000 - 0x0000000800000000]
[0.014s][info][cds] Preferred address to map heap data (to avoid relocation) is 0x00000007bfc00000
[0.015s][info][cds] Mapped static region #2 at base 0x00007fa21d6ab000 top 0x00007fa21d6eb000 (Bitmap)
[0.015s][info][cds] Heap data mapped at 0x00000007ffc00000, size = 1075264 bytes
[0.015s][info][cds] CDS heap data relocation delta = 1073741824 bytes
[0.015s][info][cds] optimized module handling: enabled
[0.015s][info][cds] full module graph: enabled
[0.015s][info][cds] use_full_module_graph = true; java.base = 0x0000000800507f18
[0.022s][info][cds] patching heap embedded pointers: narrowOop 0xf7f80000 -> 0xfff80000
[0.022s][info][cds] CDS heap data relocation quick delta = 0x8000000
[0.036s][info][cds] Unmapping region #2 at base 0x00007fa21d6ab000 (Bitmap)