RFR: 8378764: fileStream::fileSize() fails for >2GB files on Windows

Ralf Schmelter rschmelter at openjdk.org
Fri Feb 27 06:40:19 UTC 2026


Since fileStream::fileSize() returned a long value, which is 32 bits on Windows, the method fails for >= 2 GB files on Windows. Since it is only used during the merge of segmented heap dumps, the problem only shows up when merging large heap dumps.

I've changed the return value to jlong and used the proper 64 bit _fseeki64() and _ftelli64() methods on Windows. 

I have not included a specific test case, since it would use more than 4 GB of disk space. But if that would be not a problem, I could add one.

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

Commit messages:
 - Make fileStream::fileSize() return jlong instead of long.

Changes: https://git.openjdk.org/jdk/pull/29952/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29952&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8378764
  Stats: 19 lines in 2 files changed: 15 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/29952.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29952/head:pull/29952

PR: https://git.openjdk.org/jdk/pull/29952


More information about the hotspot-dev mailing list