RFR: JDK-8261167: print_process_memory_info add a close call after fopen

Matthias Baesken mbaesken at openjdk.java.net
Thu Feb 4 16:59:54 UTC 2021


Hello, there is an fopen call opening "proc/self/status" in print_process_memory_info in os_linux.cpp. This call should also have a corresponding fclose-call.

See also the Sonar finding ("Opened stream never closed. Potential resource leak") :
https://sonarcloud.io/project/issues?id=shipilev_jdk&open=AXck8BNvBBG2CXpcnaeA&resolved=false&severities=BLOCKER&types=BUG

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

Commit messages:
 - JDK-8261167

Changes: https://git.openjdk.java.net/jdk/pull/2409/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2409&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261167
  Stats: 36 lines in 1 file changed: 14 ins; 10 del; 12 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2409.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2409/head:pull/2409

PR: https://git.openjdk.java.net/jdk/pull/2409


More information about the hotspot-runtime-dev mailing list