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

Use ajv.addSchema to load validation schemas at build #382

Merged
merged 1 commit into from
Jan 18, 2022

Conversation

MSE99
Copy link
Contributor

@MSE99 MSE99 commented Jan 17, 2022

Checklist

Uses ajv.addSchema to load all validation schemas while building the code instead of serializing the schema to an object literal that is eventually passed ajv.validate.

Could fix the memory leak discussed in #379

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really good implementation, this seems something we should do anyway.

@mcollina
Copy link
Member

@mattbishop can you verify this solves your leak?

@mcollina mcollina requested review from Eomm and zekth January 17, 2022 13:41
@mattbishop
Copy link

Yes I will do so.

Copy link
Member

@zekth zekth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent

@mattbishop
Copy link

Pulling this version in my package.json:

"fast-json-stringify": "MSE99/fast-json-stringify#fix/memory-leak#379",

@mattbishop
Copy link

This version is much more in line with 2.7.13, and I can run my load test without memory failures. It's a good fix for my use case.

Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mcollina mcollina merged commit dedcef8 into fastify:master Jan 18, 2022
@matthyk matthyk mentioned this pull request Mar 10, 2022
2 tasks
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

Successfully merging this pull request may close these issues.

5 participants