Skip to content

Instantly share code, notes, and snippets.

View khellan's full-sized avatar

Knut Hellan khellan

View GitHub Profile
@khellan
khellan / test.erl
Created September 19, 2011 07:56
no_auto_import directive test
-module(test).
-compile({no_auto_import,[min/2]}).
-export([test/2]).
test(A,B) ->
min(A,B).
min(A,B) when A<B -> A;
@khellan
khellan / doc.json
Created August 5, 2011 11:09
Test document for memory leak
{"id":"something","type":"test","category":"test","title":"a dummy document created for a test","description":"in certain settings, ruby with yajl leaks memory constantly. In order to reproduce this error a long input file with json needs to be used. multiples of this object should be able to do the job"}
@khellan
khellan / leak.rb
Created June 29, 2011 18:09
Yajl parsing memory leak with Rubinius pre2.0.0
!/usr/bin/env ruby
require "rubygems"
require "yajl"
input = ARGV.shift
count = 0
Yajl::Parser.parse(open(input)) {|line| count += 1}
puts count