-
Notifications
You must be signed in to change notification settings - Fork 13
Performance issues / memory core dumps with big files #65
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
Comments
Thanks for reporting! This may be caused by the underlying I'll look into whether or not this can be avoided, otherwise I may have to switch to a different streaming JSON parser (or write my own...). (e.g. https://www.npmjs.com/package/stream-json) In the meantime, increasing your Node memory is the only easy way to fix this I think. |
@rubensworks Is it theoretically possible to parse JSON-LD with a streaming JSON parser? IIUC the format does not guarantee that all transformations are defined up-front. IOW, at the end of the stream a transformation may be defined that has to be applied to an element in the beginning of the stream. I'm not sure whether this is a good example, but I'm thinking along the following lines: {
"abc": "def",
"key": "123",
"@context": {
"@vocab": "https://example.com/",
"key": "@id"
}
} |
@wouterbeek Great question, the full answer is available in this spec. TL;DR, under certain assumptions, JSON-LD can be parsed in a streaming manner. |
Too bad the order is not enforced in the JSON-LD specification :-( An alternative would be to parse JSON-LD files twice: once to extract the schema and once to apply it. |
True, the only way to enforce this is via the streaming profile.
This is essentially what this parser will do internally when streaming mode is disabled (with some optimizations where possible). |
Uh oh!
There was an error while loading. Please reload this page.
We're experiencing the jsonld streaming parser to go out of memory for large files.
To reproduce, store the following file as
test.js
in the project directory.To run this file:
Tested on version
2.0.2
and node12.18.0
/14.4.0
.The text was updated successfully, but these errors were encountered: