Project

General

Profile

java.lang.OutOfMemoryError On Startup

Subir Jolly
Added over 5 years ago

Getting "java.lang.OutOfMemoryError: unable to create new native thread" on tigase startup. I am running java 7 with your latest(beta) tigase-xmltools and tigase-utils. I am running:

tigase-server: 5.2.0-beta3

tigase-utils: 3.4.2-5.2.0-beta3

tigase-xmltools: 3.4.4-5.2.0-beta3

mysql connector java: 5.1.17

Kindly find the attached log file with some logs just before the error, tigase.conf and init.properties files I am using.

Thanks,

Subir


Replies (8)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

What machine are you trying to run the Tigase on? What operating system? What kind of Java do you use?

If this is a VM than maybe the VM has too little memory? From the tigase.conf it looks like you have assigned about 600MB of memory to Tigase. Does your system have that much memory available?

Added by Subir Jolly over 5 years ago

We are running tigase on a hardware box. The operating system is a el6(2.6) box. Java is jdk 1.7. Amount of RAM on that box is 80GB.

I have even tried giving 6GB to tigase and still I get this error message.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

My question was what kind of Java is this. Is it the OpenJDK, Oracle (SUN) or something else.

It you run it on the system with 80GB of RAM than make sure you run Java in 64bit mode which should be a default.

The only explanation I have, without further investigation is that when you run Tigase it does not use your memory settings but it uses some Java default memory settings instead. What command do you use to start Tigase?

Try this to see what settings are used at the startup time:

./scripts/tigase.sh check etc/tigase.conf

Added by Subir Jolly over 5 years ago

I am using oracle(SUN) java 7.0_40. I tried manually running java in 64 bit mode using -d64 in tigase.conf.

Ran ./usr/share/tigase/scripts/tigase.sh check /etc/tigase/tigase.conf

The output is attached as a text file. Also, the output seemed fine. I tried running tigase with openjdk 1.6 too which also yielded the same results.

Added by Subir Jolly over 5 years ago

Figure out the solution. I just needed to up the number of processes for tigase user in /etc/security/limits.d/90-nproc.conf file.

Thank you for your support.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Thank you for letting us know. The Java error - OOM suggested something completely else. This is the first time I see a problem with number of processes. Indeed, Tigase is very heavy on a number of threads it spawns and the number of threads is proportional to a number of CPUs/CPU cores/CPU threads.

Could you please share your limits.d settings for the number of processes which worked for you and your CPU HW specification?

Added by Subir Jolly over 5 years ago

I did have this number set in /etc/security/limits.conf file. But apparently files in /etc/security/limits.d override limits.conf file. So, the file I mentioned earlier now has the following text:

*              soft    nproc     1024
root           soft    nproc     65536
tigase_usr     soft    nproc     65536

We have a 16 core 2.27 GHz box with 72GB RAM.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Hm, we did not have an opportunity to test recent versions of Tigase on a machine with more than 8 cores.

Thank you for information.

    (1-8/8)