<commit_before>#!/usr/bin/env ruby
def mem(pid)
  parent_rss = `ps p #{pid} -o rss`
  children_rss = `ps --ppid #{pid} -o rss`
  overall = parent_rss.split("\n").last.to_i
  children_rss.split("\n").drop(1).each do |mem|
    overall += mem.to_i
  end
  overall
end

t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
pid = Process.spawn(*ARGV.to_a)
mm = 0

Thread.new do
  mm = mem(pid)
  while true
    sleep 0.1
    m = mem(pid)<commit_msg>not use children memory check in darwin<commit_after>#!/usr/bin/env ruby
def mem(pid)
  parent_rss = `ps p #{pid} -o rss`
  overall = parent_rss.split("\n").last.to_i
  unless RUBY_PLATFORM =~ /darwin/
    children_rss = `ps --ppid #{pid} -o rss`
    children_rss.split("\n").drop(1).each do |mem|
      overall += mem.to_i
    end
  end
  overall
end



t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
pid = Process.spawn(*ARGV.to_a)
mm = 0

Thread.new do
  mm = mem(pid)
  while true
    sleep 0.1
    m = mem(pid)
{'fraction_non_alphanumeric': 0.15160955347871236, 'fraction_numerical': 0.008307372793354102, 'mean_word_length': 3.1913043478260867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6995938', 'n_tokens_mistral': 403, 'n_tokens_neox': 394, 'n_words': 93}