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)
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)
- relates to
-
JDK-8340368 windows-x64-slowdebug build fails after JDK-8319873
-
- Resolved
-
-
JDK-8340391 Windows jcmd System.map and System.dump_map tests failing
-
- Resolved
-
-
JDK-8340401 DcmdMBeanPermissionsTest.java and SystemDumpMapTest.java fail with assert(_stack_base != nullptr) failed: Sanity check
-
- Resolved
-
-
JDK-8318636 Add jcmd to print annotated process memory map
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/4ff17c14
-
Review(master) openjdk/jdk/20597
(1 links to)