Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Extensions, Windows
-
Labels:None
-
Environment:jruby 1.6.0.dev (ruby 1.8.7 patchlevel 249) (2010-06-30 2d1eff7) (Java HotSpot(TM) Client VM 1.6.0_18) [x86-java]
screenshot gem v 0.0.4
-
Testcase included:yes
-
Number of attachments :
Description
This code:
require 'rubygems'
require "benchmark"
require 'win32/screenshot'
t = "Internet Explorer"
Benchmark.bmbm do |x|
x.report("no file") {50.times {Win32::Screenshot.window(t, 0) {}}}
end
Eventually crashes [1] in jruby, because a MemoryPointer appears to suddenly be unwritable.
It succeeds well with MRI.
Maybe jruby's underlying FFI implementation should do its own memory management, like calling out to malloc and free, to avoid Java's GC (which I assume is the cause [2]).
-r
[1] http://gist.github.com/458719
[2] http://wiki.github.com/ffi/ffi/core-concepts#memory
Activity
Charles Oliver Nutter
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Component/s | Extensions [ 12281 ] | |
| Component/s | Windows [ 13600 ] |
ref: http://github.com/jarmo/win32screenshot/issues/#issue/2