updated so that java memory parameters can be set dynamically