Checks system to set maxHeap

also added manual argument passable in commandline to set maxHeapSize