require "X11/Display"

X11::RTable.each_with_index {|r,i|
	printf "%3d: %s\n", i, if r then r.join("#") else r end
}

GC.start
h={}
ObjectSpace.each_object {|o|
	h[o.type] ||= 0
	h[o.type] += 1
}

h.keys.sort {|a,b| h[b] <=> h[a] }.each {|k|
	v = h[k]
	printf "%20s: %s\n", k, v
}
