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

Thomas Stuefe stuefe at openjdk.org
Fri Feb 27 06:53:18 UTC 2026


On Fri, 27 Feb 2026 06:30:42 GMT, Ralf Schmelter <rschmelter at openjdk.org> wrote:

> 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.

Good.

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29952#pullrequestreview-3865269852


More information about the hotspot-dev mailing list