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

JS heap out of memory when using detail view #19

Closed
Dzar34 opened this issue Jun 10, 2022 · 6 comments
Closed

JS heap out of memory when using detail view #19

Dzar34 opened this issue Jun 10, 2022 · 6 comments
Assignees
Labels
bug Something isn't working done

Comments

@Dzar34
Copy link

Dzar34 commented Jun 10, 2022

Hello, thanks for building this! Unfortunately, every time I attempt to search my vault, I can see a list of my notes for a split second, then I get an error. Message copied below. Thanks for any help!

Error: Worker terminated due to reaching memory limit: JS heap out of memory

__node_internal_captureLargerStackTrace:errors:464:5
NodeError:errors:371:5
Worker.[kOnExit]:worker:279:26
Worker..onexit:worker:201:20

@marcjulianschwarz
Copy link
Collaborator

marcjulianschwarz commented Jun 10, 2022

Hello @Dzar34,

looks like you have too many notes for the Detail View as it will have to load the content for every note (unfortunately, will have to investigate if there is a better solution).
How many notes does your vault contain?
Try turning off the Detail View in the extensions preferences.

If that doesn’t help I will take a look at it. And I will try to find a solution for it to work with any amount of notes.

@marcjulianschwarz marcjulianschwarz self-assigned this Jun 10, 2022
@marcjulianschwarz marcjulianschwarz added bug Something isn't working help wanted Extra attention is needed labels Jun 10, 2022
@marcjulianschwarz marcjulianschwarz changed the title Error whenever I attempt to search my vault JS heap out of memory when using detail view Jun 14, 2022
@Dzar34
Copy link
Author

Dzar34 commented Jun 18, 2022

Thanks for responding! I did turn off detail view, but I am still getting the same error. I have 10,650 notes 😳 I may just be an outlier!

@marcjulianschwarz
Copy link
Collaborator

I was able to reproduce the error by creating a vault with 10.000 notes each with 100 words. It looks like the notes load just fine (independent of detail view state).

Logging the current memory usage reveals that the extension uses about 0.06 GB which should not be enough to reach the memory limit of node.
Another thing that I noticed was that everything worked as long as I was slowly going through the search results. The second I held down an arrow key (thus going through the results very fast) it reached the memory limit. The same thing happens when using the search, going through different queries fast will fill result in an error but it won't crash when I search slowly.

Help from someone with more experience is greatly appreciated as I currently don't know how to fix this.

@marcjulianschwarz marcjulianschwarz added done and removed help wanted Extra attention is needed labels Jun 19, 2022
@marcjulianschwarz
Copy link
Collaborator

marcjulianschwarz commented Jun 19, 2022

Found a way to get this fixed. Seems like Raycast can't handle rendering for more than 1k-3k list items. With the newest commit only 1000 items will be rendered and they change based on the search query.

You can try out the new version by cloning the repository, running npm install and then starting the extension with npm run dev. Let me know when everything is working.

@marcjulianschwarz
Copy link
Collaborator

This has been fixed with version 1.6.0 which has now been released.

@Dzar34
Copy link
Author

Dzar34 commented Jun 22, 2022

It works great!! Thanks so much for creating this and working on a fix. I love it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working done
Projects
None yet
Development

No branches or pull requests

2 participants