Skip to content

Commit 892aad0

Browse files
committed
Clarify the effect of InitialMmapSize on Windows platform
Signed-off-by: Benjamin Wang <[email protected]>
1 parent fd0af9d commit 892aad0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

db.go

+6
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,12 @@ type Options struct {
12591259
// If <=0, the initial map size is 0.
12601260
// If initialMmapSize is smaller than the previous database size,
12611261
// it takes no effect.
1262+
//
1263+
// Note: On Windows, due to platform limitations, the database file size
1264+
// will be immediately resized to match `InitialMmapSize` (aligned to page size)
1265+
// when the DB is opened. On non-Windows platforms, the file size will grow
1266+
// dynamically based on the actual amount of written data, regardless of `InitialMmapSize`.
1267+
// Refer to https://github.com/etcd-io/bbolt/issues/378#issuecomment-1378121966.
12621268
InitialMmapSize int
12631269

12641270
// PageSize overrides the default OS page size.

0 commit comments

Comments
 (0)