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

Heap out of memory error #335

Open
WillTDA opened this issue Nov 28, 2021 · 3 comments
Open

Heap out of memory error #335

WillTDA opened this issue Nov 28, 2021 · 3 comments

Comments

@WillTDA
Copy link

WillTDA commented Nov 28, 2021

Sometimes when using this package, a heap out of memory error occurs. This usually happens with longer strings.

Version: 1.0.3
Node Version: 16.6

@dangowans
Copy link
Member

Thanks for the report.

Yes, the current way things work, a lot of memory is required to process long strings. There have been some significant improvements made since version 1.0.3 that do a bit better with memory, but there are more improvements in that space that can be made. Your project would need to accept ESM packages though.

A suggestion for the short term I could make is splitting the string into chunks, possible by spaces, then processing each chunk separately.

@WillTDA
Copy link
Author

WillTDA commented Nov 29, 2021

Thanks, I'll take a look at implementing the solution 👍 How would I make my project accept ESM modules, if I was to do so?

@dangowans
Copy link
Member

The best set of instructions I've seen for moving a project to ESM popped up on my screen after updating a dependency written by the legendary Sindre Sorhus. I consult it on the regular.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants