Skip to content

Commit

Permalink
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/jruby.2.3.mspec
Original file line number Diff line number Diff line change
@@ -4,6 +4,16 @@ require 'rbconfig'
require 'java'
require 'jruby'

# Some non-deterministic specs assume a GC will actually fire. For spec
# runs we change our noop version of GC.start to requesting we actually
# perform a GC on the JVM.
module GC
def start
java.lang.System.gc
end
module_function :start
end

IKVM = java.lang.System.get_property('java.vm.name') =~ /IKVM\.NET/
WINDOWS = RbConfig::CONFIG['host_os'] =~ /mswin/

3 comments on commit 94f3e89

@kares
Copy link
Member

@kares kares commented on 94f3e89 Mar 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have been thinking of having a -Xgc.start=true flag (false - off by default). any reason not to?

@enebo
Copy link
Member Author

@enebo enebo commented on 94f3e89 Mar 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kares I did think about it. I reasoned we want this to be difficult enough that anyone who really needs to manually call into the GC will just do what I did. We had lots of earlier abuse of GC.start (with reports that we are not performing well) and I fear if we make it a flag it will just end up being in a bunch of random launching mechanisms through tools. People consuming some launching mechanism will pick those up and not realize why things suck...

@kares
Copy link
Member

@kares kares commented on 94f3e89 Mar 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - makes sense. Thanks for providing me with the context of this being historically misused ...

Please sign in to comment.