This code won't work on Windows.
I think you should use the resource python module I think: http://docs.python.org/2/library/resource.html#resource-usage
@clofresh any thought ?