LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-19-2010, 12:59 PM   #1
bellskar
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Rep: Reputation: 0
Unhappy Red5 installation issues on a WHM VPS "virtuozzo"


Red5 installation issues on a WHM VPS, CentOS 5.5 "virtuozzo"

I am having a problem, facing an error when running "ant prepare"
Code:
[property] java.io.IOException: Cannot run program "/bin/env": java.io.IOException: error=12, Cannot allocate memory
After hunting a lot for this I just got some tweaks to handle this exception, and every one has been using the way to handle this error.
I would also like the experts here to review it if it is correct or wrong. I found a simple Java program (source below) which actually reproduces the error when running on a machine (WHM 11.26.8, CENTOS 5.5 i686 "virtuozzo") in my case. I am using a simple Java program only to reproduce the problem for the experts here so that they can provide a good solution to fix the problem I am facing during the Red5 Installation on the same VPS.
Java Program (DoRuntime.java)
Code:
import java.io.*;

public class DoRuntime {
   public static void main(String args[]) throws IOException {

      Runtime runtime = Runtime.getRuntime();

      long total = runtime.totalMemory();
      long max = runtime.maxMemory();
      long free = runtime.freeMemory();
      System.out.println("total: " + total);
      System.out.println("max: " + max);
      System.out.println("free: " + free);

      Process process = runtime.exec("/bin/ls");
      InputStream is = process.getInputStream();
      InputStreamReader isr = new InputStreamReader(is);
      BufferedReader br = new BufferedReader(isr);
      String line;

      while ((line = br.readLine()) != null) {
         System.out.println(line);
      }
   }
}
According to the references I found, if we are suck with the said error, we would need to specify the heap size on runtime(or set in conf)when running Java applications. So I tried to run the same program on my VPS where I was actually facing trouble during the Red5 Installation. Here I got exactly the same error (as in Red5 installation) when I run "java DoRuntime" with the above code in it.
Code:
[/usr/local/j2se]# java DoRuntime
total: 5177344
max: 532742144
free: 4972208
Exception in thread "main" java.io.IOException: Cannot run program "/bin/ls": java.io.IOException: error=12, Cannot allocate memory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
        at java.lang.Runtime.exec(Runtime.java:610)
        at java.lang.Runtime.exec(Runtime.java:448)
        at java.lang.Runtime.exec(Runtime.java:345)
        at DoRuntime.main(DoRuntime.java:15)
Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
        at java.lang.ProcessImpl.start(ProcessImpl.java:81)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
        ... 4 more
So when i tried to follow those options to specify the Heap Size while executing the above program, the system could not let Java avail the specified heap size. Following is what I got.
Code:
 [/usr/local/j2se]# java "-Xms512m -Xmx512m" DoRuntime
Invalid initial heap size: -Xms512m -Xmx512m
Could not create the Java virtual machine.
Above even could not work with "-Xms1m -Xmx1m" or any other values. Same error was being resulted.

Any ways, I now tried to figure it out that what the hell is the problem now. I, then, just found some thing related to modify the SWAP space on the Linux machine where all this sh!t is happening. And as I am not a very good in Linux, so I started searching on how could I modify SWAP Space, and blah blah.... finally when I got well stated tutorial for that I started going on. and what I got was just where I am currently stuck at...... :/

Again as I can not post links yet but the very 1st thread I posted today on LinuxQuestions was about the issues I faced while modifying SWAP Spaces. I really would request you to visit that thread (I hope you could visit that thread by following my posts through my profile), It is titled as "Swap Space Problem". Following is the last post of mine at that thread, you can imagine how far I have been on it till now.

Quote:
Originally Posted by bellskar View Post
Thanks for your comment. I am not sure about which Virtual Environment WHM is using. but on the other hand I do have a setup on VMware on my local computer with same version of CentOS virtually on VMware and it's good with every thing as it supposed to be.

I guess on WHM, it's "virtuozzo" as it is mentioned on the header as following
Code:
WHM 11.26.8
CENTOS 5.5 i686 virtuozzo
After your comment I considered to search about the fact you mentioned that VPS may cause an issue for it. I got the following reference on a website (I can't currently post links as I have to reach 15 posts for that. So I can tell that I searched google for "swap space in linux virtuozzo" and the 3rd link in the result was redirecting to a website comparing "VMware and virtuozzo")

<!--- QUOTED TEXT --->

So what an answer would be now?
.
.
.

(I wasn't able to give links as I do not have enough posts yet so I would request you to bear with me.)

But I am still stuck on it, and need a good solution if there is.
Also please tell me if there is any confusion about relation Swap Size on linux and Heap Size to use with Java Applications.

Thanks

Last edited by bellskar; 09-19-2010 at 01:06 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple issues including: "Previous Installation hasn't been completed" sisterdelirious Linux - Software 6 09-16-2010 04:49 AM
Start red5 server via "./red5.sh" ceashton Linux - Software 5 08-08-2010 05:16 AM
[SOLVED] cfdisk issues during installation. "FATAL ERROR" AceOfSpade Slackware 10 07-28-2010 06:47 PM
Quick, Easy "Security Cheat Sheet" for new Centos 5.4 VPS? paulsm4 Linux - Security 5 04-26-2010 02:19 PM
"make headers_check" gives errors during "5.5.1 Installation of Linux API headers " void_man() Linux From Scratch 3 09-26-2007 09:16 PM


All times are GMT -5. The time now is 01:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration