{"action":"created","issue":{"url":"https://api.github.com/repos/neovim/neovim/issues/4486","repository_url":"https://api.github.com/repos/neovim/neovim","labels_url":"https://api.github.com/repos/neovim/neovim/issues/4486/labels{/name}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/4486/comments","events_url":"https://api.github.com/repos/neovim/neovim/issues/4486/events","html_url":"https://github.com/neovim/neovim/pull/4486","id":142883417,"number":4486,"title":"Remove maxmem and maxmemtot options","user":{"login":"philix","id":207795,"avatar_url":"https://avatars.githubusercontent.com/u/207795?v=3","gravatar_id":"","url":"https://api.github.com/users/philix","html_url":"https://github.com/philix","followers_url":"https://api.github.com/users/philix/followers","following_url":"https://api.github.com/users/philix/following{/other_user}","gists_url":"https://api.github.com/users/philix/gists{/gist_id}","starred_url":"https://api.github.com/users/philix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philix/subscriptions","organizations_url":"https://api.github.com/users/philix/orgs","repos_url":"https://api.github.com/users/philix/repos","events_url":"https://api.github.com/users/philix/events{/privacy}","received_events_url":"https://api.github.com/users/philix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-23T07:15:58Z","updated_at":"2016-03-26T15:52:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/4486","html_url":"https://github.com/neovim/neovim/pull/4486","diff_url":"https://github.com/neovim/neovim/pull/4486.diff","patch_url":"https://github.com/neovim/neovim/pull/4486.patch"},"body":"> The option 'maxmem' ('mm') is used to set the maximum memory used for one\r\n> buffer (in kilobytes).  'maxmemtot' is used to set the maximum memory used for\r\n> all buffers (in kilobytes).  The defaults depend on the system used.  These\r\n> are not hard limits, but tell Vim when to move text into a swap file.  If you\r\n> don't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a very large\r\n> value.  The swap file will then only be used for recovery.  If you don't want\r\n> a swap file at all, set 'updatecount' to 0, or use the \"-n\" argument when\r\n> starting Vim.\r\n\r\nOn today's systems these values are huge (4GB in my machine with 8GB of RAM\r\nsince it's set as half the available memory by default) so the limits are\r\nnever reached in practice, but Vim wastes a lot of time checking if the limit\r\nwas reached.\r\n\r\nIf the limit is reached Vim starts saving pieces of the swap file that were in\r\nmemory to the disk. Said in a different way: Vim implements its own memory\r\nswapping mechanism. This is unnecessary and inefficient since the operating\r\nsystem already virtualized the memory and will swap to the disk if programs\r\nstart using too much memory.\r\n\r\nThis change does...\r\n\r\n1. Reduce the number of config options and need for documentation.\r\n2. Make the code more efficient as we don't have to keep track of memory usage\r\n   nor check if the memory limits were reached to start swapping to disk every\r\n   time we need memory for buffers.\r\n3. Simplify the code. Once `memfile.c` is simple enough it could be replaced by\r\n   actual operating system memory mapping (`mmap`, `MemoryViewOfFile`...).\r\n\r\nThis change does not prevent Vim to recover changes from swap files since the\r\nswapping code is never triggered with the huge limits set by default."},"comment":{"url":"https://api.github.com/repos/neovim/neovim/issues/comments/201866823","html_url":"https://github.com/neovim/neovim/pull/4486#issuecomment-201866823","issue_url":"https://api.github.com/repos/neovim/neovim/issues/4486","id":201866823,"user":{"login":"justinmk","id":1359421,"avatar_url":"https://avatars.githubusercontent.com/u/1359421?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmk","html_url":"https://github.com/justinmk","followers_url":"https://api.github.com/users/justinmk/followers","following_url":"https://api.github.com/users/justinmk/following{/other_user}","gists_url":"https://api.github.com/users/justinmk/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmk/subscriptions","organizations_url":"https://api.github.com/users/justinmk/orgs","repos_url":"https://api.github.com/users/justinmk/repos","events_url":"https://api.github.com/users/justinmk/events{/privacy}","received_events_url":"https://api.github.com/users/justinmk/received_events","type":"User","site_admin":false},"created_at":"2016-03-26T15:52:02Z","updated_at":"2016-03-26T15:52:02Z","body":"Nice changes @philix."}}