Java Max Heap size problem

Hi there, I have been able to run Wowza and Java last week, but now Java doesnt run anymore. I am getting the now familliar

Error occurred during initialization of VM

Could not reserve enough space for object heap

*** glibc detected *** free(): invalid pointer: 0xb7e10280 ***

I can I make sure Java is not trying to get too much memory and stop when not getting it?

I have read in my search for some answers that some VPS which use burstable memory (which is my case) can cause Java not to work, as Java can see / expect all memory available (including Burst memory) and output this error when it is not available.

Is there anyway to control the heap size of memory required by Java?

Even the following requests don’t work

java -version -Xmx64M

java -version -Xms16M -Xmx64M

Any help would be grately appreciated…

Strangely, here are the logs from wowza, which points to Java… Does anyone know what it means?

INFO server server-start 2008-10-27 15:50:44 - - - - - 0.512 - - - - - - Wowza Media Server Pro Unlimited 1.5.3 build7825 -

INFO server comment 2008-10-27 15:50:44 - - - - - 0.513 - - - - - - - Serial number: XXXXX-XXXXX-XXXXX-XXXXX-YUJTA

INFO server comment 2008-10-27 15:50:44 - - - - - 0.514 - - - - - - - Maximum connections: Unlimited

INFO server comment 2008-10-27 15:50:44 - - - - - 0.515 - - - - - - - Hardware Available Processors: 16

INFO server comment 2008-10-27 15:50:44 - - - - - 0.518 - - - - - - - Hardware Physical Memory: 614MB/640MB

INFO server comment 2008-10-27 15:50:44 - - - - - 0.518 - - - - - - - Max File Descriptor Count: 1024

INFO server comment 2008-10-27 15:50:44 - - - - - 0.519 - - - - - - - Open File Descriptor Count: 37

INFO server comment 2008-10-27 15:50:44 - - - - - 0.519 - - - - - - - OS Name: Linux

INFO server comment 2008-10-27 15:50:44 - - - - - 0.52 - - - - - - - OS Version: 2.6.18-028stab057.4

INFO server comment 2008-10-27 15:50:44 - - - - - 0.52 - - - - - - - OS Architecture: i386

INFO server comment 2008-10-27 15:50:44 - - - - - 0.521 - - - - - - - Java Name: Java HotSpot™ Client VM

INFO server comment 2008-10-27 15:50:44 - - - - - 0.521 - - - - - - - Java Vendor: Sun Microsystems Inc.

INFO server comment 2008-10-27 15:50:44 - - - - - 0.522 - - - - - - - Java Version: 10.0-b23

INFO server comment 2008-10-27 15:50:44 - - - - - 0.522 - - - - - - - Java Home: /usr/java/jre1.6.0_07

INFO server comment 2008-10-27 15:50:44 - - - - - 0.522 - - - - - - - Java Max Heap Size: 254MB

INFO server comment 2008-10-27 15:50:44 - - - - - 0.523 - - - - - - - Java Architecture: 32

INFO server comment 2008-10-27 15:50:44 - - - - - 0.539 - - - - - - - CMDInterface now listening: [any]:8083

INFO vhost vhost-start 2008-10-27 15:50:44 - - - - - 0.578 - - - - - - defaultVHost -

INFO server comment 2008-10-27 15:50:44 - - - - - 0.578 - - - - - - - vhost home directory: /usr/local/WowzaMediaServerPro

INFO vhost comment 2008-10-27 15:50:44 - - - - - 0.859 - - - - - - defaultVHost RTMP/RTMPT bind attempt ([any]:1935)

INFO vhost comment 2008-10-27 15:50:44 - - - - - 0.861 - - - - - - defaultVHost Bind successful ([any]:1935)

INFO vhost comment 2008-10-27 15:50:44 - - - - - 0.862 - - - - - - defaultVHost RTMP/RTMPT bind attempt ([any]:20)

INFO vhost comment 2008-10-27 15:50:44 - - - - - 0.863 - - - - - - defaultVHost Bind successful ([any]:20)

The Wowza logs look fine but with a couple of odd numbers in there. The physical memory values look a bit low considering it is reporting 16 processors.

The Java Max Heap Size: does look on the low side as well but if the memory is only 640MB them this is probibly right.

INFO vhost comment 2008-10-27 15:50:44 - - - - - 0.859 - - - - - - defaultVHost RTMP/RTMPT bind attempt ([any]:1935)

INFO vhost comment 2008-10-27 15:50:44 - - - - - 0.861 - - - - - - defaultVHost Bind successful ([any]:1935)

INFO vhost comment 2008-10-27 15:50:44 - - - - - 0.862 - - - - - - defaultVHost RTMP/RTMPT bind attempt ([any]:20)

INFO vhost comment 2008-10-27 15:50:44 - - - - - 0.863 - - - - - - defaultVHost Bind successful ([any]:20)

This doesn’t look right either. Where did port 20 come from?

I think it is just a limitation of VPS, a shared resource. Maybe some VPS has more in the share and can run Wowza barely, and others not even.

It’s possible depending on your usage that Wowza on EC2 would be comparable economically.

Richard

Sorry guys, after reading the wowza logs, I stopped and restarted wowza service, and

IT IS WORKING…

so can anyone tell me why

java -version

still returns

Error occurred during initialization of VM
Could not reserve enough space for object heap
*** glibc detected *** free(): invalid pointer: 0xb7d7a280 ***
Aborted

?

Hi Richard, Roger,

thanks a lot for your replies.

I am discussing with the VPS provider about the 16 cores, and they are telling me it runs on a QUAD core…

I have set the Max Heap size for Java myself as the application would not launch with a value above that (I had 300m at one point, but later on it didnt accept that value anymore…)

Finally for the port 20, it was the only port available to stream, which I found after trial and error going through the list of open ports the VPS provide, but now they have opened 1935.

Do you recommend not to direct to port 20 ??

thanks again guys…

best regards

Damien