JDK-8134540 : Much nearly duplicated code for PerfMemory support
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-08-26
  • Updated: 2021-01-27
  • Resolved: 2021-01-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.
JDK 17
17 b06Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
For Linux, Solaris, BSD, and AIX the implementations of PerfMemory support (perfMemory_<os>.cpp) are very similar, with many of the differences being merely code formatting and spelling, capitalization, and formatting in comments.  Many of the remaining differences appear to be unimportant and could be reconciled.

I think these perfMemory_<os>.cpp files could be mostly merged into a single implementation in os/posix.

Comments
Changeset: 82adfb32 Author: Harold Seigel <hseigel@openjdk.org> Date: 2021-01-19 13:44:07 +0000 URL: https://git.openjdk.java.net/jdk/commit/82adfb32
19-01-2021

According to JDK-8223699 the O_NOFOLLOW code is no longer needed.
22-01-2020

These files are mostly the same except aix has some conditional code with NOFOLLOW that I don't know anything about. It says it came from Solaris. Resolving the block of code in AIX would enable these files to be merged to perfMemory_posix.cpp From perfMemory_aix.cpp: // Helper functions for open without O_NOFOLLOW which is not present on AIX 5.3/6.1. // We use the jdk6 implementation here. #ifndef O_NOFOLLOW // The O_NOFOLLOW oflag doesn't exist before solaris 5.10, this is to simulate that behaviour // was done in jdk 5/6 hotspot by Oracle this way static int open_o_nofollow_impl(const char* path, int oflag, mode_t mode, bool use_mode) { ... #endif I have no idea what this is. [~stuefe] is this still needed?
18-01-2019

I made this 9 so we could replace -XX:+PrintMiscellaneous -XX:+Verbose with logging but we could do this post jdk9 also.
24-03-2016

I was trying to stomp out occurrences of -XX:+PrintMiscellaneous in favor of Unified logging and there are many in these files.
22-03-2016