JDK-8319873 : Add windows implementation for jcmd System.map and System.dump_map
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2023-11-10
  • Updated: 2024-10-24
  • Resolved: 2024-09-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b16Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Provide a Windows implementation based on VirtualQuery.

Porter hints:

See what we do in linux (os/linux/memMapPrinter_linux.cpp and os/linux/procMapsParser.cpp). One would probably copy at least the former over to os/windows, then re-implement parts as needed. Instead of scanning /proc/self/smaps, one would call VirtualQuery, starting at 0, and then "feel" ones way upward through the address space. 

Use e.g. os::print_memory_mappings in os_windows.cpp for inspiration - not sure if that could be re-used, but that one could at least serve as a blueprint.

Some parts of the Linux implementation cannot be translated, of course (e.g. the Linux-specific mapping info like page size or similar). But at least "reserved" and "committed" states printing should be doable.

One also needs to activate some common code paths than handle System.map for all platforms, or at least for Windows+Linux. (There is a complementary "Implement System.map on MacOS" issue, but it had found no takers so far, so we closed it. It is also subjectively less important than Windows and Linux)
Comments
Changeset: 4ff17c14 Branch: master Author: Simon Tooke <stooke@openjdk.org> Date: 2024-09-18 09:11:40 +0000 URL: https://git.openjdk.org/jdk/commit/4ff17c14a572a59b60d728c3626f430932eecea6
18-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20597 Date: 2024-08-15 13:45:16 +0000
19-08-2024

We need this, and it will be a good starter issue for someone with Windows knowledge
17-07-2024

Runtime Triage: This is not on our current list of priorities. We will consider this feature if we receive additional customer requirements.
12-07-2024