-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Bug]: Out of memory #171
Comments
does that happen every time you try opening the plugin? or does it only happen when starting the plugin in a repo with many files? If so, do you know around how many files/levels there are in the repo? |
or is there anything different in the repo where this is happening compared to others where this doesn't happen |
The plugin doesn't load all the files into memory, but it does traverse the entire repo to get the names of the files. The contents of the files are not accessed until you navigate to that file either via the browser or neovim. I would be surprised if there was a memory problem from getting the names of the files. |
Also, did the browser ever open and did anything load? |
The browser never open. nothing load. It only shows github-preview: init in notification history. Is there a way to enable more logs? |
Actually, I tried on small repo as well but it does not work. Could be because I'm using nix with devenv, direnv? devenv will create a |
We also run try adding a require("github-preview").setup({
-- ...other settings
log_level = "verbose"
}) this should print out stuff to your neovim bunx bunvim logs github-preview |
Hi, I managed to make the browser open. After adding log_level, it started to work. I notice that the kitty terminal/neovim was freezed for like 10s. When I expect it crashes, the browser open! YAY!!!!. And the next time I open with GithubPreviewToggle command, it opens browser without issue. Things I changed: I upgraded bun from 1.0.7 to 1.0.11, which might fix some issues with memory loading. The performance is still not great. There are some lags like 5~10 seconds when you open a new folder in the sidebar. Also it takes around ~10sec to open a file to view. All of these happens only the first time you open the file or closing github preview and reopen it. I guess the file loading is not very fast. You might want to take a look at how nvim-tree or neo-tree implement it. Some suggestions:
|
There must be something else. I'm testing the plugin on a base macbbook pro 2.6 GHz 6-Core Intel Core i7, 16 GB ram and everything is pretty much instant. When opening a folder, we use globby to get a list of files/dirs. Globby is based on fast-glob which claims to be the fastest in nodejs. When reading the contents of a file we're doing it the way bun says is "heavily optimized and represent the recommended way to perform file-system tasks using Bun." what are the specs of your machine? |
My spec:
|
Since I get it working, I think we can close the issue now. Will reopen if I experience this issue again. Thanks a lot for your hard work. This plugin is great |
What happened?
After installing the plugin, try opening github-preview with GithubPreviewToggle.
I got the notification saying github-preview: init.
After 10s, the terminal crash saying it's using too much memory.
I guess the plugin load all the files into memory to display on browser.
What browsers are you seeing the problem on?
Firefox
:checkhealth
The text was updated successfully, but these errors were encountered: