You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code runs extremely slow on JRuby 9.1.2.0. 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.
module M
X = 1
def x(v)
v == X
end
end
time = Time.now
100000.times do |i|
o = ''
o.extend(M)
o.x(i)
p (Time.now - time).to_i if i % 1000 == 0
end
It runs smoothly when there are no constants defined in the module.
Environment
JRuby 9.1.2.0
java version "1.8.0_20"
OS X 10.11.5 (same problem on Linux as well)
Expected Behavior
The script runs within 1 second. (It prints 100 "0"s on MRI 2.2.2 and JRuby 1.7.19.)
Actual Behavior
0
2
7
14
25
38
54
74
94
115
139
167
193
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)
219
245
274
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:
Thank you. I've tested it with the nightly snapshot and it doesn't crash any more.
However it's still slower than JRuby 1.7.19. It takes less than 1 second in JRuby 1.7 and about 6 seconds in JRuby 9.1.3.0-SNAPSHOT. Not a big problem though.
The following code runs extremely slow on JRuby 9.1.2.0. 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.
It runs smoothly when there are no constants defined in the module.
Environment
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: