RFR: JDK-8326586: Improve Speed of System.map

Thomas Stuefe stuefe at openjdk.org
Fri Feb 23 20:11:17 UTC 2024


A small optimization that speeds up `jcmd pid System.map` by orders of magnitude by optimizing NMT cache lookup for sequential accesses. This cache is used to map NMT against System information - and the latter usually comes in sequential form, e.g. scanned from `/proc/<pid>/maps` or via VirtualQuery.

On Linux x64, `System.map`for a JVM with an artificially bloated process space (1 million mappings) takes:

before this patch: 6.3 minutes
with this patch: 4.2 seconds

which is a 87x speed improvement.

Ping @jdksjolen and @gerard-ziemski?

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

Commit messages:
 - start

Changes: https://git.openjdk.org/jdk/pull/17984/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17984&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8326586
  Stats: 12 lines in 1 file changed: 10 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/17984.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17984/head:pull/17984

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


More information about the hotspot-runtime-dev mailing list