The following code runs extremely slow on JRuby 220.127.116.11. It defines a module with a constant and a method that refers to the constant, and then create objects that are extended by the module and call the method defined in the module.
I couldn't find the reason but it gets slower over time and eventually crashes with java.lang.StackOverflowError.
X = 1
v == X
time = Time.now
100000.times do |i|
o = ''
p (Time.now - time).to_i if i % 1000 == 0
It runs smoothly when there are no constants defined in the module.
java version "1.8.0_20"
OS X 10.11.5 (same problem on Linux as well)
The script runs within 1 second. (It prints 100 "0"s on MRI 2.2.2 and JRuby 1.7.19.)
Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=245760Kb used=213510Kb max_used=213736Kb free=32249Kb
bounds [0x000000010611b000, 0x000000011511b000, 0x000000011511b000]
total_blobs=15266 nmethods=14704 adapters=473
compilation: disabled (not enough contiguous free space left)
Error: Your application used more stack memory than the safety cap of 2048K.
Specify -J-Xss####k to increase it (#### = cap size in KB).
Specify -w for full java.lang.StackOverflowError stack trace
The text was updated successfully, but these errors were encountered: