Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major 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 :
      0

      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

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Roger Pack
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: