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

[Bug]: Heap out of Memory when compiling large json values #41991

Open
SasinduDilshara opened this issue Jan 17, 2024 · 0 comments
Open

[Bug]: Heap out of Memory when compiling large json values #41991

SasinduDilshara opened this issue Jan 17, 2024 · 0 comments
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug

Comments

@SasinduDilshara
Copy link
Contributor

Description

Following code gets a HeapOutOfMemory error while compiling.

service /jsonpath on new http:Listener(9090) {
    resource function get test() returns error|json {
        return jp:readJson(store, `$.store.book[*].price`);
    }
}

json store = <large json with 100000+ fields>
ballerina: Oh no, something really went wrong. Bad. Sad.

We appreciate it if you can report the code that broke Ballerina in
https://github.com/ballerina-platform/ballerina-lang/issues with the
log you get below and your sample code.

We thank you for helping make us better.

[2024-01-16 19:33:52,931] SEVERE {b7a.log.crash} - Java heap space 
java.lang.OutOfMemoryError: Java heap space
        at com.google.gson.internal.LinkedTreeMap.find(LinkedTreeMap.java:192)
        at com.google.gson.internal.LinkedTreeMap.put(LinkedTreeMap.java:117)
        at com.google.gson.JsonObject.add(JsonObject.java:69)
        at com.google.gson.JsonObject.addProperty(JsonObject.java:92)
        at org.ballerinalang.diagramutil.SyntaxTreeMapGenerator.apply(SyntaxTreeMapGenerator.java:641)
        at org.ballerinalang.diagramutil.SyntaxTreeMapGenerator.transformSyntaxNode(SyntaxTreeMapGenerator.java:189)
        at org.ballerinalang.diagramutil.SyntaxTreeMapGenerator.transformSyntaxNode(SyntaxTreeMapGenerator.java:75)
        at io.ballerina.compiler.syntax.tree.NodeTransformer.transform(NodeTransformer.java:212)

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@SasinduDilshara SasinduDilshara added Type/Bug Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. labels Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Projects
None yet
Development

No branches or pull requests

1 participant