Stack memory overflow


I occasionally get the following output when I run my code ( is
just a quick way of me running the java command with all the options I


Error: Your application used more stack memory than the safety cap of
Specify -J-Xss####k to increase it (#### = cap size in KB).
Specify -w for full StackOverflowError stack trace

In every case so far where I’ve tried to track down the cause in recent
code, it’s turned out that I’ve specified a name wrong. Perhaps I
mention a variable or such that doesn’t exist. Some typo like that.

In MRI ruby I’m used to ruby telling me the exact line where it has a
problem. In JRuby I seem to sometimes get the above cryptic message
with no clue as to where the culprit is. As you can imagine, if I’ve
made large changes recently it’s tedious to go through trying to figure
out which line is giving the trouble.

Is there a way for me to get JRuby to actually tell me the line it’s
having trouble with?


I’ve tried adding -w, but the output seems to be jruby/java code
unrelated to my own code.

Further information: I suspect this occurs when I call a non-existent
method, and not when I get a variable name wrong. It would be much more
useful if it would just fail upon missing method and tell me where it
failed than just giving a generic stackoverflowerror.