allow to change java memory limits

useful for people with not so much RAM, as well as
for people with too much RAM

example usage on linux:
    export CUSTOM_JAVA_MEMORY_LIMIT=2048M

Change-Id: Ic84ea6010cc093a8f141f484beaeae525b227482