<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>dbg.rb</filename>
    </added>
    <added>
      <filename>getpid.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,15 +2,10 @@ require 'rubygems'
 require 'sinatra'
 
 require 'mymath'
+require 'dbg'
 
 require 'activesupport'
 
-def dbg
-  require 'ruby-debug'
-  Debugger.start
-  debugger
-end
-
 helpers do
   def time(t)
     t = t.to_f
@@ -73,7 +68,7 @@ helpers do
   end
 
   def mb(bytes)
-    bytes./(1_000_000.0).round_to(2)
+    bytes./(1024*1024.0).round_to(2)
   end
 end
 
@@ -158,6 +153,9 @@ __END__
       %th Binary size
       %td{:colspan =&gt; 4}= size(total_binary_size(stats[:binsize]))
     %tr
+      %th Working set
+      %td{:colspan =&gt; 4}= size stats[:working_set]
+    %tr
       %th Github repository size
       %td{:colspan =&gt; 4}= size stats[:repo]
 </diff>
      <filename>app.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require 'win32ole'
 require 'rubygems'
 require 'win32/process'
+require 'dbg'
 
 puts &quot;Cleaning ...&quot;
 system 'ruby stats.rb --clean'</diff>
      <filename>retry.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,18 +12,13 @@ MSPEC_OPTIONS = &quot;-Gcritical&quot;
 require 'fileutils'
 require 'mymath'
 require 'benchmark'
-
+require 'win32ole'
 require 'net/http'
 require 'uri'
 
 require 'rubygems'
 require 'net/scp'
-
-def dbg
-  require 'ruby-debug'
-  Debugger.start
-  debugger
-end
+require 'dbg'
 
 #
 # Helpers
@@ -85,6 +80,29 @@ module Stats
       inject({}){ |s, f| s[f] = File.size(f); s          }
   end
 
+  def working_set
+    working_set = 0
+    begin
+      t = Thread.new{ system &quot;#{IR} #{CD}/getpid.rb&quot; }
+      puts &quot;Letting IronRuby run for 5 seconds...&quot;
+      sleep(5)
+      puts &quot;Getting working set&quot;
+      pid = File.open(&quot;#{DATA}/pid&quot;, 'r'){|f| f.read }
+      processes = WIN32OLE.connect(&quot;winmgmts://&quot;).ExecQuery(
+        &quot;select * from win32_process where ProcessId = #{pid}&quot;)
+      if processes.count == 1
+        processes.each{|p| working_set = p.WorkingSetSize}
+      else
+        puts &quot;*Error: found more than one process with pid==#{pid}&quot;
+      end
+      Thread.kill(t)
+      Process.kill(9, pid)
+    rescue
+      FileUtils.rm &quot;#{DATA}/pid&quot; if File.exist? &quot;#{DATA}/pid&quot;
+    end
+    working_set.to_i
+  end
+
   def github_size
     get_ironruby_from_github[:size]
   end
@@ -248,6 +266,10 @@ class DataReporter &lt; BaseReporter
     throughput
   end
 
+  def report_working_set
+    working_set
+  end
+
   def report_mspec_language
     _mspec(:language)
   end
@@ -335,6 +357,10 @@ class TextReporter &lt; BaseReporter
     &quot;Throughput: (100000 iterations): #{data.map{|k,v| &quot;#{k}(#{v} s)&quot;}.join(&quot;, &quot;)}\n&quot;
   end
   
+  def report_working_set
+    &quot;Working set: #{mb data} MB\n&quot;
+  end
+
   def report_mspec_language
     _mspec
   end
@@ -362,7 +388,7 @@ private
   end
 
   def mb(bytes)
-    bytes./(1_000_000.0).round_to(2)
+    bytes./(1024*1024.0).round_to(2)
   end
 end
 </diff>
      <filename>stats.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8da8fd78db1859dbb73af5af8bd9aa627a71ca83</id>
    </parent>
  </parents>
  <author>
    <name>Jimmy Schementi</name>
    <email>jschementi@gmail.com</email>
  </author>
  <url>http://github.com/jredville/ironruby-stats/commit/a3b2ac48e492994f498ee1b1f34280b2bc113ae3</url>
  <id>a3b2ac48e492994f498ee1b1f34280b2bc113ae3</id>
  <committed-date>2009-02-05T11:29:07-08:00</committed-date>
  <authored-date>2009-02-05T11:29:07-08:00</authored-date>
  <message>Workings Set</message>
  <tree>1a43f97d458e5fd0753a792bf61a98cdc74a4c83</tree>
  <committer>
    <name>Jimmy Schementi</name>
    <email>jschementi@gmail.com</email>
  </committer>
</commit>
