Skip to content

OutOfMemoryError Occurs with Large Files in Cache.java #4852

@0pdd

Description

@0pdd

The puzzle 4846-59b6e8f7 from #4846 has to be resolved:

* @todo #4846:30min OutOfMemoryError for large files in cache.
* The sha method reads the entire file into memory using Files.readAllBytes(file) which
* could cause OutOfMemoryError for large files. Consider using a streaming approach with
* MessageDigest.update() in a loop to hash the file in chunks, similar to how it's typically
* done for large file hashing operations.

The puzzle was created by @yegor256 on 03-Feb-26.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions