adding java memory option

Sidekick: @lars2893 

Add default memory option that can be overridden.