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

MMAP makes machine swap a lot #383

Open
Scooletz opened this issue Aug 29, 2024 · 1 comment
Open

MMAP makes machine swap a lot #383

Scooletz opened this issue Aug 29, 2024 · 1 comment
Labels
bug Something isn't working operating system OS related issue, that may require intrinsic knowledge of low level OS stuff

Comments

@Scooletz
Copy link
Contributor

Scooletz commented Aug 29, 2024

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 and FlushViewOfAFile is called only at the end to be followed by FlushFileBuffers. Still, according to my understanding system should flush what is needed on it's own so that the swap is not affected.

@Scooletz Scooletz added operating system OS related issue, that may require intrinsic knowledge of low level OS stuff bug Something isn't working labels Aug 29, 2024
@ssonthal
Copy link
Contributor

ssonthal commented Sep 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working operating system OS related issue, that may require intrinsic knowledge of low level OS stuff
Projects
Status: Todo
Development

No branches or pull requests

2 participants