Description:
java.lang.OutOfMemoryError: GC overhead limit exceeded
Dumping heap to /usr/lib/ballerina/ballerina-0.981.0/heap-dump.hprof ...
Unable to create /usr/lib/ballerina/ballerina-0.981.0/heap-dump.hprof: Permission denied
Steps to reproduce:
Run following code
import ballerina/io;
function test(int n) returns (int) {
if(n==1) {return 1;}
return test(n) * n;
}
function main(string... args) {
io:println(test(5));
}
Affected Versions:
Instead of letting bvm to go out of memory I think we need to throw an error indicating stackoverflow and terminate the program.
Mail thread[1] started in ballerina-dev group to discuss about limiting call frame depth.
[1] - https://groups.google.com/forum/#!topic/ballerina-dev/tfwUqAuvbT4
This should be fixed in the master with the PR https://github.com/ballerina-platform/ballerina-lang/pull/12642
now it should throw StackOverflow error