Simplified out of memory exception throw.
Added exception.
Added support for jvm args.