Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Freezer a real memory mapped struct? #29793

Open
Shawn-Huang-Tron opened this issue May 16, 2024 · 1 comment
Open

Is Freezer a real memory mapped struct? #29793

Shawn-Huang-Tron opened this issue May 16, 2024 · 1 comment

Comments

@Shawn-Huang-Tron
Copy link

Shawn-Huang-Tron commented May 16, 2024

I see the description above Freezer:
https://github.com/ethereum/go-ethereum/blob/v1.13.14/core/rawdb/freezer.go#L57

// Freezer is a memory mapped append-only database to store immutable ordered
// data into flat files:
//
//   - The append-only nature ensures that disk writes are minimized.
//   - The memory mapping ensures we can max out system memory for caching without
//     reserving it for go-ethereum. This would also reduce the memory requirements
//     of Geth, and thus also GC overhead.

I checked all of the code about Freezer, but I can't find the memory-mapping-related function.
Instead, I find that it seems like just write into os.File ? https://github.com/ethereum/go-ethereum/blob/v1.13.14/core/rawdb/freezer_batch.go#L187

@namiloh
Copy link

namiloh commented May 16, 2024

That's odd indeed. Nothing memory-mapped about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants