first shot, does not bail out on memory but does not scale on cores either
second try, does not bail out on memory and scales on cores