{"action":"opened","issue":{"url":"https://api.github.com/repos/tmux-plugins/tmux-resurrect/issues/255","repository_url":"https://api.github.com/repos/tmux-plugins/tmux-resurrect","labels_url":"https://api.github.com/repos/tmux-plugins/tmux-resurrect/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/tmux-plugins/tmux-resurrect/issues/255/comments","events_url":"https://api.github.com/repos/tmux-plugins/tmux-resurrect/issues/255/events","html_url":"https://github.com/tmux-plugins/tmux-resurrect/issues/255","id":327215630,"number":255,"title":"[Discussion/Thoughts] lazy load vim (or other processes) only when entering the session  after resurrecting","user":{"login":"dylan-chong","id":17482349,"avatar_url":"https://avatars1.githubusercontent.com/u/17482349?v=4","gravatar_id":"","url":"https://api.github.com/users/dylan-chong","html_url":"https://github.com/dylan-chong","followers_url":"https://api.github.com/users/dylan-chong/followers","following_url":"https://api.github.com/users/dylan-chong/following{/other_user}","gists_url":"https://api.github.com/users/dylan-chong/gists{/gist_id}","starred_url":"https://api.github.com/users/dylan-chong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylan-chong/subscriptions","organizations_url":"https://api.github.com/users/dylan-chong/orgs","repos_url":"https://api.github.com/users/dylan-chong/repos","events_url":"https://api.github.com/users/dylan-chong/events{/privacy}","received_events_url":"https://api.github.com/users/dylan-chong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-29T08:21:41Z","updated_at":"2018-05-29T08:21:41Z","closed_at":null,"author_association":"NONE","body":"\r\n\r\n# Intro\r\n\r\nSo I have a really weird setup using tmux that probably not many other people use, so just a disclaimer --- maybe the issue I describe here isn't so important. I keep all of the windows, sessions, and [neo]vims open for all of the different projects are use --- including the ones that I haven't touched in six months, but plan on getting back to later. The setup is ready convenient because when I want to switch to the project, I don't have to worry about `cd`ing \r\n\r\nWhat this has ended up with is roughly 80 bash processes running, including 32 neovims (each of which has several tabs open). These all get started up when I restart my computer and then open tmux (I actually don't mind the wait time since I almost never reboot my computer). Now, the bash processes only use up roughly 2.8MB each, and the total 220MB isn't that much especially when it mostly can be written to swap. \r\n\r\n# Problem\r\n\r\nStarting all the vim processes causes various other node and python processes to be started up. I have done my best to reduce this (by telling my linting plug-ins do not run when vim is started) but it seems these processes start even for syntax highlighting alone (so there's not much I can do about that). So this causes me to (apparently) to have roughly `123 python processes * 12MB + 37 node processes * 30MB = 1.5GB + 1.1GB = 2.6GB` of RAM used up by node and python processes. This sounds like a lot.\r\n\r\n# Possible Solution\r\n\r\nThe most obvious solution would be to not keep all of my vims/sessions open all of the time. However, if I do this then I will lose the convenience of having the sessions there.\r\n\r\nWhat I want to propose is the option to lazy load vims (or any other processes that the user could want automatically started only when opening the session for the first time). So specifically, when resurrecting the setup after a system restart, don't start a 'vim' process until the user navigates to the session that has vim in it. This would solve the RAM usage problem\r\n\r\n---\r\n\r\nAnyway, these are just some thoughts, hopefully ones that you found entertaining. This is not a critical problem as I guess most people don't do what I do, but would be interesting if it could be solved.\r\n"}}
{"actor":{"display_login":"dylan-chong"}}