-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #4486 'refactor: Remove maxmem, maxmemtot options'
After this change we never release blocks from memory (in practice it never happened because the memory limits are never reached). Let the OS take care of that. --- On today's systems the 'maxmem' and 'maxmemtot' values are huge (4+ GB) so the limits are never reached in practice, but Vim wastes a lot of time checking if the limit was reached. If the limit is reached Vim starts saving pieces of the swap file that were in memory to the disk. Said in a different way: Vim implements its own memory-paging mechanism. This is unnecessary and inefficient since the operating system already has virtual memory and will swap to the disk if programs start using too much memory. This change does... 1. Reduce the number of config options and need for documentation. 2. Make the code more efficient as we don't have to keep track of memory usage nor check if the memory limits were reached to start swapping to disk every time we need memory for buffers. 3. Simplify the code. Once memfile.c is simple enough it could be replaced by actual operating system memory mapping (mmap, MemoryViewOfFile...). This change does not prevent Vim to recover changes from swap files since the swapping code is never triggered with the huge limits set by default.
- Loading branch information
Showing
16 changed files
with
18 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.