RFR: 8298524: Debug function to trace reachability of CDS archived heap objects [v2]

Ioi Lam iklam at openjdk.org
Mon Dec 12 22:22:24 UTC 2022


> Please review this small change to help debugging the CDS heap archiving code. 
> 
> Here's an example in gdb that shows how the `java.lang.Module` object at `0x00000005ce8d9ba0` is reached from the root (`ArchivedClassLoaders::servicesCatalogs `)
> 
> 
> Thread 8 "VM Thread" hit Breakpoint 2, HeapShared::check_module_oop (orig_module_obj=0x5ce8bf588)
>     at heapShared.cpp:1193
> 1193	  assert(DumpSharedSpaces, "must be");
> (gdb) call CDSHeapVerifier::trace_to_root(tty, orig_module_obj)
> [ 0] {0x00000005ce8bb900} jdk.internal.loader.ArchivedClassLoaders::servicesCatalogs (offset = 24)
> [ 1] {0x00000005ce8bba08} [Ljdk.internal.module.ServicesCatalog; @[0]
> [ 2] {0x00000005ce8bbb60} jdk.internal.module.ServicesCatalog::map (offset = 12)
> [ 3] {0x00000005ce8bbb70} java.util.concurrent.ConcurrentHashMap::table (offset = 40)
> [ 4] {0x00000005ce8d9638} [Ljava.util.concurrent.ConcurrentHashMap$Node; @[0]
> [ 5] {0x00000005ce8d9bc0} java.util.concurrent.ConcurrentHashMap$Node::val (offset = 20)
> [ 6] {0x00000005ce8d9b78} java.util.concurrent.CopyOnWriteArrayList::array (offset = 16)
> [ 7] {0x00000005ce8d9ba0} [Ljava.lang.Object; @[0]
> [ 8] {0x00000005ce8d9b30} jdk.internal.module.ServicesCatalog$ServiceProvider::module (offset = 12)
> [ 9] {0x00000005ce8bf588} java.lang.Module

Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:

  @calvinccheung comments -- removed outdated comment

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/11628/files
  - new: https://git.openjdk.org/jdk/pull/11628/files/d6f1a2fa..6d1d0858

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11628&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11628&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/11628.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11628/head:pull/11628

PR: https://git.openjdk.org/jdk/pull/11628


More information about the hotspot-runtime-dev mailing list