Is ObjectSpace still disabled in jruby?

303 Views Asked by At

Is ObjectSpace still disabled in jruby 9.1.5.0 (2.3.1)?

If it's not just my installation (Arch Linux, up-to-date) having a bug, I get the suspicion that ObjectSpace has changed in recent jruby: Trying to reproduce the behaviour described in jruby's wiki entry about performance, I get the following reaction:

$> jruby -O
jruby: unknown option -O
$> jruby -J-Djruby.objectspace.enabled=false
puts ObjectSpace.each_object(Class).inspect
#<Enumerator: ObjectSpace:each_object(Class)>
$> jruby -v
jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 Java HotSpot(TM) 64-Bit Server VM 25.102-b14 on 1.8.0_102-b14 +jit [linux-x86_64]

So what is the up-to-date situation? Is it now safe / recommended to use OpenSpace in modern jruby?

1

There are 1 best solutions below

0
On BEST ANSWER

it hasn't changed - is the same as in previous JRuby (1.7.x)

ObjectSpace (even while disabled) works for meta-classes ... it is used by Rails and is easy to implement in JRuby without the performance cost.