Skip to content

Instantly share code, notes, and snippets.

View jfirebaugh's full-sized avatar

John Firebaugh jfirebaugh

View GitHub Profile
@jfirebaugh
jfirebaugh / memleak.rb
Created May 16, 2011 18:04 — forked from munkyboy/memleak.rb
script that shows memleak in jruby on certain windows platforms
require 'java'
require 'benchmark'
def foo
Benchmark.measure {
sc = org.jruby.embed.ScriptingContainer.new(org.jruby.embed.LocalContextScope::SINGLETHREAD, org.jruby.embed.LocalVariableBehavior::TRANSIENT)
sc.runScriptlet("require 'win32api'")
sc.runScriptlet("SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'LLLLP', 'L'")
sc.terminate
sc = nil