Unable to launch Spark with port

I am unable to launch Spark by using below command. Is anyone facing similar issue?

spark-shell --master yarn --conf spark.ui.port=46242

Multiple versions of Spark are installed but SPARK_MAJOR_VERSION is not set
Spark1 will be picked by default
Java HotSpot™ 64-Bit Server VM warning: INFO: os::commit_memory(0x0000741db9500000, 175112192, 0) failed; error=‘Cannot allocate memory’ (errno=12)