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: Open
  • Resolution: Unresolved
  • OS: windows
  • Submitted: 2023-11-10
  • Updated: 2024-08-19
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.
Other
tbdUnresolved
Related Reports
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
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