Sha256: 2d6c6f5512fcc1ef5ae4263f43e9c2328a3b42139f43ea1eb6ab78d169b41cec

Contents?: true

Size: 797 Bytes

Versions: 9

Compression:

Stored size: 797 Bytes

Contents

%w{ lib test }.each do |path|
  path = File.expand_path(File.dirname(__FILE__) + '/../' + path)
  $: << path unless $:.include?(path)
end

require 'fileutils'


def self_ps
  ps = `ps -v #{$$}`.split("\n").last.split(' ')
  %w{
    pid stat time sl re pagein vsz rss lim tsiz pcpu pmem command
  }.inject({}) { |h, k|
    h[k.intern] = ps.shift; h
  }
end

def pmem (msg)
  p [ msg, "#{self_ps[:vsz].to_i / 1024}k" ]
end

pmem 'starting'

require 'rubygems'
require 'rufus/tokyo/util'

pmem 'required'

l = Rufus::Tokyo::List.new

100000.times { |i| l << i.to_s }

pmem 'stored'

#100000.times { |i| l.delete_at(0) }
#100000.times { |i| s = l.delete_at(0); Rufus::Tokyo::CabinetLib.tcfree(s) }
s = nil
100000.times { |i| s ||= l.delete_at(0); }
p s.class
p s.public_methods.sort

pmem 'cleared'

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
rufus-tokyo-1.0.7 test/mem1.rb
rufus-tokyo-1.0.6 test/mem1.rb
rufus-tokyo-1.0.5 test/mem1.rb
rufus-tokyo-1.0.4 test/mem1.rb
metry-1.0.0 vendor/rufus-tokyo/test/mem1.rb
metry-1.0.1 vendor/rufus-tokyo/test/mem1.rb
metry-1.1.0 vendor/rufus-tokyo/test/mem1.rb
metry-1.2.0 vendor/rufus-tokyo/test/mem1.rb
rufus-tokyo-0.1.3 test/mem1.rb