Wowza Community

Could not reserve enough space for object heap. Could not create the Java VM

Moved to a new VPS hosting. (server with 650 mb ram)

I fresh installed the latest java JDK

I fresh installed wowza 2

root@cpanel [/usr/local/WowzaMediaServer/bin]# ./startup.sh
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I searched the wowza forums, and found threads suggesting to edit

/usr/local/WowzaMediaServer/bin/setenv.sh 

I did that. I think originally it was

JAVA_OPTS="-Xmx768M"

I tried instead:

JAVA_OPTS="-Xmx384M"

and also:

JAVA_OPTS="-Xmx128M"

But I still get memory errors and Wowza won`t run.

I have about 550 mb ram free.

Any ideas, please?

Thanks

Hi

Is the Java version that you’re running 32bit or 64bit?

I think this happens with 32bit.

Jason

Take a look at this line in the log startup lines:

Hardware Physical Memory: 275MB/1024MB

The VMS has 1024MB of RAM, but only 275MB is free. I think there is even less by the time java heap is allocated then Wowza continues to startup. This is just not a good server for Wowza.

Richard

Try reducing the java heap size to 192M. It should start and have some streaming capacity.

Richard

Right, sorry. So you already down to 128. Well, you have to keep going lower till it works. Even at 128 it is not a very useful streaming server anyway. Take a look at the Wowza partners page for other hosting options:

http://www.wowza.com/partners

Richard

Hi Jason, thanks for answering

I Installed the 64 bit rpm Java JDK on a 64bit server.

I already unistalled wowza and reinstalled - problem persists!

Thats what Im getting:

root@cpanel [/]# java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

I`m currently reinstalling wowza2 (3rd time) after having uninstalled+reinstalled JDK.

When this is done I`ll look into the logs and be back to report, thanks

After having installed JDK and Wowza again, without errors and trying to run it as a standalone for the first time, instead of a prompt for Serial I get the usual error.

The wowzamediaserver_error.log was empty and these are the contents of the wowzamediaserver_access.log right after the error:

#Version: 1.0
#Start-Date: 2012-04-18 15:02:41 CDT
#Software: Wowza Media Server 2.0.0 build22912
#Date: 2012-04-18
#Fields: date	time	tz	x-event	x-category	x-severity	x-status	x-ctx	x-comment	x-vhost	x-app	x-appinst	x-duration	s-ip	s-port	s-uri	c-ip	c-proto	c-referrer	c-user-agent	c-client-id	cs-bytes	sc-bytes	x-stream-id	x-spos	cs-stream-bytes	sc-stream-bytes	x-sname	x-sname-query	x-file-name	x-file-ext	x-file-size	x-file-length	x-suri	x-suri-stem	x-suri-query	cs-uri-stem	cs-uri-query
2012-04-18	15:03:53	CDT	server-start	server	INFO	200	Wowza Media Server 2 Developer 2.0.0 build22912	-	-	-	-	71.424	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Serial number: XXXXX-XXXXX-XXXXX-XXXXX-7FQ87	-	-	-	71.425	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Maximum connections: 10	-	-	-	71.433	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Hardware Available Processors: 1	-	-	-	71.434	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Hardware Physical Memory: 275MB/1024MB	-	-	-	71.435	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Hardware Swap Space: 15311MB/16383MB	-	-	-	71.436	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Max File Descriptor Count: 1024	-	-	-	71.436	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Open File Descriptor Count: 37	-	-	-	71.437	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	OS Name: Linux	-	-	-	71.437	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	OS Version: 2.6.18-274.3.1.el5.028stab094.3	-	-	-	71.438	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	OS Architecture: amd64	-	-	-	71.438	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Java Name: Java HotSpot(TM) 64-Bit Server VM	-	-	-	71.439	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Java Vendor: Oracle Corporation	-	-	-	71.439	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Java Version: 1.7.0_03	-	-	-	71.439	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Java VM Version: 22.1-b02	-	-	-	71.44	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Java Spec Version: 1.7	-	-	-	71.44	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Java Home: /usr/java/jdk1.7.0_03/jre	-	-	-	71.441	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Java Max Heap Size: 123MB	-	-	-	71.441	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:53	CDT	comment	server	INFO	200	-	Java Architecture: 64	-	-	-	71.442	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:54	CDT	comment	server	INFO	200	-	CMDInterface now listening: [any]:8083	-	-	-	72.812	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:54	CDT	comment	server	INFO	200	-	_defaultVHost_ home directory: /usr/local/WowzaMediaServer	-	-	-	73.001	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:55	CDT	vhost-start	vhost	INFO	200	_defaultVHost_	-	-	-	-	74.005	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:55	CDT	comment	vhost	INFO	200	_defaultVHost_	Bind attempt ([any]:1935)	-	-	-	74.171	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:55	CDT	comment	vhost	INFO	200	_defaultVHost_	Bind successful ([any]:1935)	-	-	-	74.174	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:55	CDT	comment	vhost	INFO	200	_defaultVHost_	Bind attempt ([any]:8086)	-	-	-	74.176	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:03:55	CDT	comment	vhost	INFO	200	_defaultVHost_	Bind successful ([any]:8086)	-	-	-	74.177	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:07	CDT	vhost-stop	vhost	INFO	200	_defaultVHost_	-	-	-	-	85.397	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:07	CDT	server-stop	server	INFO	200	-	-	-	-	-	85.406	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
#Version: 1.0
#Start-Date: 2012-04-18 15:04:42 CDT
#Software: Wowza Media Server 2.0.0 build22912
#Date: 2012-04-18
#Fields: date	time	tz	x-event	x-category	x-severity	x-status	x-ctx	x-comment	x-vhost	x-app	x-appinst	x-duration	s-ip	s-port	s-uri	c-ip	c-proto	c-referrer	c-user-agent	c-client-id	cs-bytes	sc-bytes	x-stream-id	x-spos	cs-stream-bytes	sc-stream-bytes	x-sname	x-sname-query	x-file-name	x-file-ext	x-file-size	x-file-length	x-suri	x-suri-stem	x-suri-query	cs-uri-stem	cs-uri-query
2012-04-18	15:04:43	CDT	server-start	server	INFO	200	Wowza Media Server 2 Developer 2.0.0 build22912	-	-	-	-	0.785	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Serial number: XXXXX-XXXXX-XXXXX-XXXXX-7FQ87	-	-	-	0.788	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Maximum connections: 10	-	-	-	0.788	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Hardware Available Processors: 1	-	-	-	0.795	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Hardware Physical Memory: 278MB/1024MB	-	-	-	0.797	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Hardware Swap Space: 15311MB/16383MB	-	-	-	0.797	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Max File Descriptor Count: 1024	-	-	-	0.798	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Open File Descriptor Count: 37	-	-	-	0.798	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	OS Name: Linux	-	-	-	0.799	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	OS Version: 2.6.18-274.3.1.el5.028stab094.3	-	-	-	0.799	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	OS Architecture: amd64	-	-	-	0.8	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Java Name: Java HotSpot(TM) 64-Bit Server VM	-	-	-	0.8	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Java Vendor: Oracle Corporation	-	-	-	0.801	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Java Version: 1.7.0_03	-	-	-	0.801	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Java VM Version: 22.1-b02	-	-	-	0.802	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Java Spec Version: 1.7	-	-	-	0.802	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Java Home: /usr/java/jdk1.7.0_03/jre	-	-	-	0.803	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Java Max Heap Size: 123MB	-	-	-	0.803	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	Java Architecture: 64	-	-	-	0.804	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	CMDInterface now listening: [any]:8083	-	-	-	1.346	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:43	CDT	comment	server	INFO	200	-	_defaultVHost_ home directory: /usr/local/WowzaMediaServer	-	-	-	1.394	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:45	CDT	vhost-start	vhost	INFO	200	_defaultVHost_	-	-	-	-	3.002	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:45	CDT	comment	vhost	INFO	200	_defaultVHost_	Bind attempt ([any]:1935)	-	-	-	3.16	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:45	CDT	comment	vhost	INFO	200	_defaultVHost_	Bind successful ([any]:1935)	-	-	-	3.161	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:45	CDT	comment	vhost	INFO	200	_defaultVHost_	Bind attempt ([any]:8086)	-	-	-	3.164	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-
2012-04-18	15:04:45	CDT	comment	vhost	INFO	200	_defaultVHost_	Bind successful ([any]:8086)	-	-	-	3.165	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-

Java Architecture is 64.

Just tried wowza3 . Same error.

please notice in the logs I posted:

Java Max Heap Size: 123MB

Is that heap size normal?

It`s just the same as when before I reinstalled JDK :

jaroot@cpanel [~]# java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

Following your suggestion, Richard, I gave up my previous attempt to move to this new host, and stayed with my previous one. 2 months gone by and Im trying again, on a new server and having the exact same problem with yet another host. The first time it was Mochahost, now its vpsLatch. The strange thing is that both hosts offer packages with 1024 RAM and the current host on which Wowza is running without problem has only 768 RAM !

I installed wowza without errors on the new host but when trying to start it I got:

Then I edited the bin/setenv.sh to:

JAVA_OPTS="-Xmx128M"

Then I tried running it again and this time I get:

(The Log error I get is only because I tried editing the Log4j.properties file in order to get a log of the problem and did a bad job, I need to fix that)

But this time it says 285mb out of 1024 (whereas in the previous host, it said 275MB out of 1024MB)

Does this host , too lack RAM or am I having here some other kind of a problem?

Thanks

Hi JasonH,

I suppose it`s VMware as the first error says:

error occured during the initialization of VM

Not sure about what production level actually means. My current host is running Wowza and serving flv files without problem with only 768MB RAM.

Are saying, JasonH, that I should be thankfull its running in the current host as it its not supposed to and that if I want to move to a new one I`d better make sure it has no less than 4 GB RAM, please?

Thanks Richard,

Just to make sure I understand you correctly,

Do you mean I should change inside setenv.sh to JAVA_OPTS="-Xmx192M" from the current “-Xmx128M”?

Or should I change it elsewhere?

Thanks

I changed the heap size to 100, than 64 than 32 than 16 - same error no matter what.

Richard, I must admit I`m very confused.

How can it be that on Hostgator`s “VPS3” package of 768MB RAM everything is running without any error, with the original heapsize setting of 768M, and two new different servers who claim more RAM have the exact same error occurs no matter how ridiculously low I go with the heap size?

I admit my knowledge and understanding of the java environemnt is nil. Still, I simply dont understand how no amount of memory is low enough especially, as Im not working it hard, just attempting to run without any load while on the working server it can carry the load of multiple clients requests. I cannot help but wonder if there is not a missing factor or setting here.

I tried reproducing the same conditions as on the working server - such as installing JRE instead of JDK and then installing the same older JRE version (build 1.6.0_18-b07) but to no avail.

Thanks for the list of Wowza-partners but as far as I could understand they are rather streaming services and not low-cost VPS services on which I can install Wowza by myself, or if they are, prices are much higher than what I`m aiming at currently, while developping my environement

I invested a lot of time and effort in adapting scripts and modules for Wowza to my needs, and maybe I`m on the step of giving it all up which to me is really sad.

Hi

When Wowza starts up in stand-alone mode does it say in the logs that it’s using the 64bit architecture?

There is a guide here,

https://www.wowza.com/docs/how-to-manually-install-and-troubleshoot-java-on-your-wowza-media-server

Jason

Hi

Start-up logs should look something like this:

Java Name: Java HotSpot™ 64-Bit Server VM

Java Vendor: Sun Microsystems Inc.

Java Version: 1.6.0_31

Java VM Version: 20.6-b01

Java Spec Version: 1.6

Java Home: C:\Program Files\Java\jre6

Java Max Heap Size: 682MB

Java Architecture: 64

Java Locale[user.language]: en

Java Locale[user.country]: GB

Note the bold “Java Architecture: 64” which is what you should be looking for.

Jason

Hi

Yes I see that Java is running in 64bit, I take it you still have this problem after seeing that 64bit java is being used?

So something else must be causing this problem then,

I noticed that you are running Wowza 2.0.0 and it would be a good idea to upgrade.

What happens when you type? (on the command line) :

java -version

Jason

Hi

I think that 123MB is to low but Wowza should still run.

What happens when you type? (on the command line) :

java -version

Jason

Hi

What is the virtual environment that you are running?

For example VMWare or Xen

The minimum Wowza specs are here,

System Requirements

Minimum recommended production hardware CPU: Single Quad Core, 3.00 GHz or better

RAM: 4GB

Disk: 2 or more in RAID 0 (striping)

Network: 1Gb Ethernet

Supported operating systemsWindows® (XP, Vista, 7, Server 2003 & 2008)

Linux (all distributions)

Solaris

Mac® OS

Unix

Java (required)Java Runtime Environment (JRE) 6 or greater or Java Development Kit (JDK) 6 or greater

You should have 4GB of RAM at a minimum to run Wowza at a production level.

Jason

Maybe it Helps Idk i got the same error as u got , i just modified the Heap Size File on Wowza to 512 M then it started and i got the Java Error That u got Above then i Changed to 128 M and it simply worked no lags or something i am streaming with 4500 Kbps everything is alright , i bought a server with 10 Gbps Nic so now it goes very good