Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Im trying to get Solr up and running, at first I had the JDK.1.6 working fine, then tomcat running fine too. All of a sudden when trying to run Solr for the first time however I get the error message:

[root@78 bin]# ./java -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Ive deleted Tomcat, deleted the JDK and reinstalled the latest JRE but still get the error message even when trying to get the version number of Java.

top - 18:47:15 up 207 days, 13:50,  1 user,  load average: 0.08, 0.03, 0.00
Tasks:  42 total,   1 running,  41 sleeping,   0 stopped,   0 zombie
Cpu(s):  5.0%us,  0.2%sy,  0.0%ni, 94.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    786432k total,   376656k used,   409776k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

The setup Ive got is: Dual CPU Dual Core AMD Opteron 512MB RAM 40GB HDD

Im almost new to UNIX and so any help or advice would be really helpful, thanks guys

Running processes are:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      18   0 10332  636  600 S    0  0.1   0:08.28 init
 1752 psaadm    15   0  176m  29m  17m S    0  3.9   0:03.76 httpsd
 1785 psaadm    15   0  173m  24m  14m S    0  3.1   0:02.03 httpsd
 5308 psaadm    15   0  174m  32m  21m S    0  4.2   0:02.70 httpsd
 6107 apache    25   0  347m  47m 5616 S    0  6.2   1:48.26 httpd
11493 root      15  -4 12588  320  316 S    0  0.0   0:00.00 udevd
12105 root      15   0 60592 1224  676 S    0  0.2   0:00.00 sshd
13659 apache    15   0  345m  46m 4784 S    0  6.1   0:57.14 httpd
15855 root      15   0 21628  768  672 S    0  0.1   0:13.75 xinetd
15986 root      15   0 40848  592  536 S    0  0.1   0:00.38 couriertcpd
16086 root      18   0 33540 1184 1120 S    0  0.2   0:00.28 courierlogger
16117 root      21   0 40848  536  532 S    0  0.1   0:00.00 couriertcpd
16119 root      21   0 33544 1072 1068 S    0  0.1   0:00.00 courierlogger
16135 root      15   0 40848  592  536 S    0  0.1   0:03.09 couriertcpd
16137 root      18   0 33540 1184 1120 S    0  0.2   0:01.70 courierlogger
16154 root      18   0 40852  536  532 S    0  0.1   0:00.00 couriertcpd
16157 root      18   0 33540 1124 1120 S    0  0.1   0:00.00 courierlogger
16287 qmails    18   0  3832  512  428 S    0  0.1   2:03.49 qmail-send
16289 qmaill    18   0  3780  508  444 S    0  0.1   0:36.67 splogger
16290 root      18   0  3816  408  324 S    0  0.1   0:00.09 qmail-lspawn
16291 qmailr    17   0  3820  404  328 S    0  0.1   0:16.95 qmail-rspawn
16292 qmailq    18   0  3772  368  324 S    0  0.0   0:15.61 qmail-clean
17669 root      18   0 12592 1180  908 R    0  0.2   0:00.03 top
18190 root      15   0  318m  25m 9000 S    0  3.3   0:36.21 httpd
19687 apache    16   0  347m  47m 5764 S    0  6.2   1:10.59 httpd
19710 named     25   0  180m 2572 1744 S    0  0.3   0:03.06 named
19809 root      18   0 11908 1152 1148 S    0  0.1   0:00.01 mysqld_safe
20166 apache    15   0  347m  47m 5696 S    0  6.2   1:07.68 httpd
20340 mysql     15   0  303m  35m 5620 S    0  4.7 185:56.38 mysqld
23747 apache    15   0  412m  46m 5768 S    0  6.0   0:38.23 httpd
23791 root      15   0  166m 7504 4216 S    0  1.0   0:02.39 httpsd
23901 root      15   0 20836  616  548 S    0  0.1   3:37.38 crond
23926 root      18   0 46648  416  412 S    0  0.1   0:00.00 saslauthd
24084 root      18   0 46648  160  156 S    0  0.0   0:00.00 saslauthd
24297 root      15   0 96636 4032 3112 S    0  0.5   0:00.20 sshd
24302 root      18   0 12180 1804 1308 S    0  0.2   0:00.17 bash
24431 root      18   0  152m 1112  664 S    0  0.1   0:25.77 rsyslogd
24435 root      18   0  3784  336  332 S    0  0.0   0:00.00 rklogd
24537 apache    15   0  344m  45m 4364 S    0  5.9   0:35.93 httpd

Its a shared server by the way.

Free -m gives me:

             total       used       free     shared    buffers     cached
Mem:           768        367        400          0          0          0
-/+ buffers/cache:        367        400
Swap:            0          0          0
share|improve this question

2 Answers 2

Java is trying to allocate an amount of memory which your system cannot spare. If no memory settings are given, Java will allocate about 60MB for its object heap. Since you are calling Java without memory setting arguments and your system has more than 60MB memory available, means Java reads memory settings from a different source. For example the environment variable JAVA_OPTS. Check your environment variables.

The settings for Java object heap are (at least for Sun JVM) -Xmx and -Xms.

share|improve this answer
    
running the command java -Xmx8m -version still results in the error –  bluedaniel Dec 20 '09 at 1:53
    
-Xmx is the maximum memory limit. But executing "-version" doesn't need much memory anyway. You probably want to check the -Xms setting. This is the amount of memory java wants to start with. –  Eduard Wirch Dec 20 '09 at 22:08

The server just needed a reboot in the end, it reminds me of a UK advert in which some fat lad is working on a Nuclear Navy submarine telling us about these complicated systems, and then at the end says if nothing else works, switching it off and on again.

pathetic

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.