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
According to the MRI docsGC::Profiler.total_time should return a timing in seconds.
JRuby implements this method, but returns a value that appears to not actually be in seconds (looks like it might actually be milliseconds). You can demonstrate this with a simple test case.
On MRI, this test case returns output like this:
Elapsed time (s): 0.155596
GC time (s?): 0.03427699999999959
On JRuby 1.7.11, the output looks like this:
ID Type Timestamp(sec) Before(kB) After(kB) Delta(kB) Heap(kB) GC Time(ms)
Elapsed time (s): 0.424
GC time (s?): 29.75
Two things about the output on JRuby:
The GC time is higher than the elapsed time, suggesting that the two measurements are not using the same units (though they should both be in seconds).
The first row of output is some spew that doesn't appear under MRI, and doesn't seem to be useful.
The implementation of total_time in JRuby seems to assume that GCInfo.getDuration returns a value in milliseconds (which is consistent with what the docs say), but it looks like that may not actually be the case. I found one reference to someone hitting a similar problem on StackOverflow, suggesting that the units changed recently.
Version info:
$ uname -a
Darwin koan.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
$ jruby -v
jruby 1.7.11 (1.9.3p392) 2014-02-24 86339bb on Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b12 [darwin-x86_64]
The text was updated successfully, but these errors were encountered:
According to the MRI docs
GC::Profiler.total_time
should return a timing in seconds.JRuby implements this method, but returns a value that appears to not actually be in seconds (looks like it might actually be milliseconds). You can demonstrate this with a simple test case.
On MRI, this test case returns output like this:
On JRuby 1.7.11, the output looks like this:
Two things about the output on JRuby:
The implementation of total_time in JRuby seems to assume that GCInfo.getDuration returns a value in milliseconds (which is consistent with what the docs say), but it looks like that may not actually be the case. I found one reference to someone hitting a similar problem on StackOverflow, suggesting that the units changed recently.
Version info:
The text was updated successfully, but these errors were encountered: