This Question is Answered (go to answer)

1 "helpful" answer available (5 pts)
2,107 Views 8 Replies Last post: Dec 3, 2008 1:28 PM by LG RSS
govisagod512 Bronze 7 posts since
Dec 2, 2008
Currently Being Moderated

Dec 2, 2008 2:03 AM

Openfire-JVM problems

Hi, I am a novice XMPP developer who try to install and configure an Openfire server in a Debian distribution. I have installed it following this process:

 

$wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3.6.2_a ll.deb --output-document=openfire_3.6.2_all.deb
--09:29:32--  http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3.6.2_a ll.deb
           => `openfire_3.6.2_all.deb'
Resolving www.igniterealtime.org... 63.246.20.125
Connecting to www.igniterealtime.org|63.246.20.125|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11,641,798 (11M) [application/octet-stream]

 

100%[====================================>] 11,641,798   739.80K/s    ETA 00:00

 

09:29:49 (659.55 KB/s) - `openfire_3.6.2_all.deb' saved [11641798/11641798]

$dpkg -i openfire_3.6.2_all.deb

Selecting previously deselected package openfire.
(Reading database ... 37494 files and directories currently installed.)
Unpacking openfire (from openfire_3.6.2_all.deb) ...
Setting up openfire (3.6.2) ...
Starting openfire: openfire.

 

However, it doesn't work. I think that it is a problem related with JVM, because of this:

 

$ java -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
$ /etc/init.d/openfire stop
Stopping openfire: openfire.
$ java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode)

 

I have found this document in the fourm, but I don't found the bin/openfire document.These are the Openfire configuration files in the server:

 

$ apt-cache show openfire
Package: openfire
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 14228
Maintainer: Jive Software <webmaster@jivesoftware.com>
Architecture: all
Version: 3.6.2
Pre-Depends: sun-java5-jre | sun-java6-jre
Conffiles:
/etc/openfire/openfire.xml 7007ba8be6e6f127372e8075f13c179f
/etc/openfire/security/keystore d3466713ffcfb3d44dfd82ff0c10c514
/etc/openfire/security/truststore 9b470f3455839329c1a5c60d9df5c89c
/etc/openfire/security/client.truststore d3466713ffcfb3d44dfd82ff0c10c514
/etc/default/openfire 52e97268baf45bade1f2ee6591365f1c
/etc/init.d/openfire 5426f46d360d76f9c93f6badb0ed2295
/etc/openfire/openfire.xml 7007ba8be6e6f127372e8075f13c179f
/etc/openfire/security/keystore d3466713ffcfb3d44dfd82ff0c10c514
/etc/openfire/security/client.truststore d3466713ffcfb3d44dfd82ff0c10c514
/etc/openfire/security/truststore 9b470f3455839329c1a5c60d9df5c89c
/etc/sysconfig/openfire c20ea0586669faf6c0eb2d9f551abedb obsolete
Description: A high performance XMPP (Jabber) server.
Openfire is an instant messaging server that implements the XMPP
(Jabber) protocol. It features high performance, a robust
administration console, and a full plugin system. The server
is 100% Java.

Openfire is a professional Open Source project, led by Jive Software.

 

I have checked that admininstration console ports are rigth in /etc/openfire/openfire.xml

 

  <adminConsole>
    <!-- Disable either port by setting the value to -1 -->
    <port>9090</port>
    <securePort>9091</securePort>
  </adminConsole>

 

and I have also changed some JVM parameters in /etc/sysconfig/openfire unsuccessfully.

 

# If you wish to set any specific options to pass to the JVM, you can
# set them with the following variable.
OPENFIRE_OPTS=" -Xmx1024m" <- Change Xmx, Xms and another parameters specified in  this document.

 

Does anybody know what could be wrong?

Thanks in advance

Tags: install, openfire, configuration, jvm
dereulenspiegel Bronze 24 posts since
Nov 3, 2008
Currently Being Moderated
Dec 2, 2008 6:16 AM in response to: govisagod512
Re: Openfire-JVM problems

A folder named"sysconfig" doesn't exist in my debian etch install. But it seems that you try to run Openfire in virtualized environment (perhabs Virtuozzo or OpenVZ). I encountered the same problem on my virtual server (although I also had problems installing the JVM). My solution was to edit the /etc/init.d/openfire. There is variable named DAEMON_OPTS in which you can insert -Xmx??m to set the maximal heap size to ?? MB. That worked for me under Debian etch in Virtuozzo environment.

dereulenspiegel Bronze 24 posts since
Nov 3, 2008
Currently Being Moderated
Dec 2, 2008 8:15 AM in response to: govisagod512
Re: Openfire-JVM problems

Strange for me this fix worked: How does your DAEMON_OPTS line looks? My first line of the DAEMON_OPTS variable looks like this:

DAEMON_OPTS="$DAEMON_OPTS -Xmx64m -server -DopenfireHome=${DAEMON_DIR} \

This way I let Openfire 64 MB for his heap. In total this makes about 100-120 MB of memory usage. May I ask how your virtual machine is configured and how much does ist cost? I considered to change my provider because I'm running very often in trouble with my numproc counter. I have a limit of 240 but Openfire seems to consume very much of the numproc ressource.

dereulenspiegel Bronze 24 posts since
Nov 3, 2008
Currently Being Moderated
Dec 2, 2008 10:42 AM in response to: govisagod512
Re: Openfire-JVM problems

The problem in Virtuozzo environments ist that the command "free" does not deliver reliable results. I my case on a machine from keyweb ist shows me the total memory of the host machine although I only have 768 MB available in my vserver. That is also the reason why java has memory problems. It tries to allocate too much memory because it "sees" the whole memory of the host machine (at least thats my theory so far). If you run the command "java -Xmx32m -version" you should get a proper output.

Your DAEMON_OPT variable looks ok. Just like mine. You said that someone already run Openfire on that virtual machine. Didn't set up everything yourself. Because already the installatiion of sun-java5-bin should be problemativ and should have gone wrong on a vserver. Another thing ist that 64 MB ist just the heap size you allow the JVM to allocate. But heap ist not the only memory. If you have only 128 MB total RAM for your vserver it is likely that your really have too few memory.

LG KeyContributor 5,452 posts since
Dec 13, 2005
Currently Being Moderated
Dec 2, 2008 1:07 PM in response to: govisagod512
Re: Openfire-JVM problems

Hi,

 

you should have read http://www.igniterealtime.org/community/docs/DOC-1021 - VPS are not meant to run Java applications.

In any case you need to tune the JVM to use as little memory as possible which also means that your installation may support not more than 100 users. You could try it with parameters like:

-Xms16m -Xmx32m -Xss128k -XX:ThreadStackSize=128 -XX:PermSize=8m -XX:MaxPermSize=64m -XX:+PrintGCDetails -Xloggc:/tmp/gc.log -Djava.net.preferIPv4Stack=true -server

Monitor the GC log and adjust the Xmx and  (decrease) MaxPermSize values as needed.

 

To start Openfire you need to chdir to the directory and enter "java -Xms16m -Xmx32m -Xss128k -XX:ThreadStackSize=128 -XX:PermSize=8m -XX:MaxPermSize=64m -XX:+PrintGCDetails -Xloggc:/tmp/gc.log -Djava.net.preferIPv4Stack=true -server -jar lib/startup.jar" - that's much faster for tests than running the start script.

 

LG

LG KeyContributor 5,452 posts since
Dec 13, 2005
Currently Being Moderated
Dec 3, 2008 1:28 PM in response to: govisagod512
Re: Openfire-JVM problems

Hi,

 

you may need to "cd openfire/bin" before you start java. And then use "... ../lib/startup.jar" instead of "... ./lib/startup.jar"

 

LG

More Like This

  • Retrieving data ...

Bookmarked By (0)