-
Notifications
You must be signed in to change notification settings - Fork 15
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
Maximum call stack size exceeded #41
Comments
Do you have the code that caused the issue? The code does detect circular structures. |
|
This looks like a linked list and the maximum call stack size is not related to a circular structure in this case. The algorithm uses a recursion and this adds up while trying to create the JSON representation of this deep linked list. You can use the Rewriting the algorithm to a non recursive one would also resolve the issue but that is likely a bit slower and a bit more complicated to implement. I would rather not do that at the moment. I am going to lose this as there's nothing else that I can do at the moment. Maybe still let me know if using the |
pino.js uses a different library and the performance is significantly more performant and this issue doesn't exist there. |
@RamiAPFM pino actually uses this library but it uses the That way the maximum call stack size error want happen and it's faster due to inspecting less entries of the linked list. |
node_modules/safe-stable-stringify/index.js:287:23
It appears I am experiencing a memory leak when attempting to log circular JSON.
Any advice on how to tackle this?
Dependencies:
The text was updated successfully, but these errors were encountered: