While running Java i faced this problem
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
This error occur because java was not able to get enough Virtual Memory as i did ulimit -a on my linux machine and i found that the virtual memory and max memory size is limited on my machine.
so i change this to unlimited by editing limits.conf file which is located in /etc/security/limits.conf and now java is working fine.
ulimit -a before making changes in limits.conf file
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 40960
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) 524288
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 40960
virtual memory (kbytes, -v) 524288
file locks (-x) unlimited
ulimit -a after making changes in limits.conf file
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 40960
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 40960
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited