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-tiktoken] memory leak #50

Open
louis030195 opened this issue Jun 13, 2023 · 3 comments
Open

[js-tiktoken] memory leak #50

louis030195 opened this issue Jun 13, 2023 · 3 comments

Comments

@louis030195
Copy link

Hey, just dropping it here, i think there is a memory leak, have a lot of memory issues dealing with large data

Weirdly I thought js-tiktoken was not using wasm:

RangeError [Error]: WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance

Sometimes

<--- Last few GCs --->

[37648:0x130008000]   106903 ms: Mark-Compact (reduce) 4081.1 (4142.1) -> 4081.1 (4142.1) MB, 2284.42 / 0.00 ms  (average mu = 0.377, current mu = 0.000) last resort; GC in old space requested
[37648:0x130008000]   111844 ms: Mark-Compact (reduce) 4081.1 (4142.1) -> 4081.1 (4142.1) MB, 4940.58 / 0.00 ms  (average mu = 0.182, current mu = 0.000) last resort; GC in old space requested


<--- JS stacktrace --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Even using

NODE_OPTIONS="--max-old-space-size=8192"

Also tried to release memory along the looping without any improvement.

If the problem keeps annoying me I'll look at your code to see if I can send a PR fix

@dqbd
Copy link
Owner

dqbd commented Jun 13, 2023

Hello! js-tiktoken should definitely not use WASM, would it be possible to share a reproducible use case?

@louis030195
Copy link
Author

@SunnyGPT
Copy link

Hello! js-tiktoken should definitely not use WASM, would it be possible to share a reproducible use case?

Hi bro, did you notice your email, I wrote you a request for help and would be happy to pay you for the content, would you mind checking it out and replying to me?

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

3 participants