Open Scooletz opened 2 weeks ago
The first solution that can help here is related to dynamically allocating memory mapped files using NtCreateSection APIs. This will reduce the size of the memory mapped files to be written to disk and saving a lot of RAM.
Secondly, during imports, we can try writing calling FlushViewOfFile and FlushFileBuffers after every 10 MB (size-wise) or 5 seconds (duration-wise) instead of doing it all at the end.
Let me know what you think.
On
Windows
, memory mapped file occasionally makes a computer swap a lot and makes Paprika behave terribly ppor. With a lot of memory committed, when the size of the mmaped region breaches the space on system disk, it starts to stall. Investigate this behavior and provide a way to fix it. This happens in a scenario of an import where mmaped file is used without any write or flushes andFlushViewOfAFile
is called only at the end to be followed byFlushFileBuffers
. Still, according to my understanding system should flush what is needed on it's own so that the swap is not affected.