Paprika icon indicating copy to clipboard operation
Paprika copied to clipboard

Reduce disk bloat on Windows

Open Scooletz opened this issue 2 years ago • 5 comments

Use the section API NtCreateSectionFunc to reduce the disk size on Windows. For inspiration take a look at the usage in LMDB. Ensure that on Windows Paprika allocated only as much as needed, not the whole file upfront.

https://github.com/LMDB/lmdb/blob/b8e54b4c31378932b69f1298972de54a565185b1/libraries/liblmdb/mdb.c#L46-L77

One more from

https://devblogs.microsoft.com/oldnewthing/20150130-00/?p=44793

Scooletz avatar Mar 01 '24 08:03 Scooletz

Hi @Scooletz, are we focusing on PagedDB block (which uses the memory-mapped files) here?

ssonthal avatar Sep 04 '24 04:09 ssonthal

Yes sir! @shubham-sonthalia

Scooletz avatar Sep 05 '24 09:09 Scooletz

At the below line, we are initializing the memory mapped file. Do we have to come up with a way to divide the max_size of the Paprika DB into equal partitions (like 5 chunks) and start with 1/5th of the max DB space? or we want it to be dynamic?

https://github.com/shubham-sonthalia/Paprika/blob/666f37225fa14e1adf0d6970f1d911aa8b7b1a49/src/Paprika/Store/PageManagers/MemoryMappedPageManager.cs#L44

image

ssonthal avatar Sep 05 '24 11:09 ssonthal

We could be dynamic, but dynamism can come with a price. If we map it separately, there will be different pointers for example.

Scooletz avatar Sep 11 '24 15:09 Scooletz

Can I please get it assigned, if that's possible?

etimofeeva avatar Mar 09 '25 17:03 etimofeeva