LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-10-2011, 12:27 AM   #1
woodzy
Member
 
Registered: Feb 2011
Posts: 31

Rep: Reputation: 0
how ot expand memery use java


Ubuntu-10.04-x86_64
3.95 GB RAM
50 GB HARDDRIVE
mysql-server-client
Java version(s): 6.0, 6u10+

i would like to know how to get my java program to use more ram for my clients so thay do not encounter lag.
this is what i have ritten up and it works error free, i would like to get it to 3GB ram usage. but when i exchang the number 1 for anything it just errors out on me
Code:
#!/bin/bash 
cd "${0%/*}"; java -Xincgc -Xmx1G -jar craft.jar

Last edited by woodzy; 03-10-2011 at 12:28 AM.
 
Old 03-10-2011, 02:08 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
What do you mean it errors out? And you should use -Xms along with -Xmx.
 
Old 03-10-2011, 03:14 AM   #3
woodzy
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by corp769 View Post
What do you mean it errors out? And you should use -Xms along with -Xmx.
FOR SOME ODD REASON I CANT USE -Xms with -Xmx its errors out and locks up, dont know why dut it does. (sorry for the caps doing 5 milloon outher things) this is the error i get allways the same.
java.io.IOException: Cannot run program "sh": 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:483)
at jline.UnixTerminal.exec(UnixTerminal.java:297)
at jline.UnixTerminal.exec(UnixTerminal.java:282)
at jline.UnixTerminal.stty(UnixTerminal.java:273)
at jline.UnixTerminal.initializeTerminal(UnixTerminal.java:77)
at jline.Terminal.setupTerminal(Terminal.java:75)
at jline.Terminal.getTerminal(Terminal.java:26)
at jline.ConsoleReader.<init>(ConsoleReader.java:191)
at jline.ConsoleReader.<init>(ConsoleReader.java:186)
at jline.ConsoleReader.<init>(ConsoleReader.java:174)
at net.minecraft.server.MinecraftServer.<init>(MinecraftServer.java:65)
at net.minecraft.server.MinecraftServer.main(MinecraftServer.java:396)
at org.bukkit.craftbukkit.Main.main(Main.java:83)
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)
... 14 more

Last edited by woodzy; 03-10-2011 at 03:22 AM.
 
Old 03-10-2011, 03:34 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
This will happen when you try to set your max size to high and you don't have enough physical memory to be allocated. If you have more than you are allocating, like in this case, check your swap space and see how much you have. If you don't have enough swap, you can get this message even though it looks like you have enough memory. Hope that helps,

Josh
 
Old 03-10-2011, 04:03 AM   #5
woodzy
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by corp769 View Post
This will happen when you try to set your max size to high and you don't have enough physical memory to be allocated. If you have more than you are allocating, like in this case, check your swap space and see how much you have. If you don't have enough swap, you can get this message even though it looks like you have enough memory. Hope that helps,

Josh
swap space? how do i look at that? my VPS it remote and i cant get to it. its over 500miles away XD
 
Old 03-10-2011, 04:04 AM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Did you set up your VPS yourself?
 
Old 03-10-2011, 04:41 AM   #7
woodzy
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by corp769 View Post
Did you set up your VPS yourself?
i select the OS and thay installed it, then i did apt-get update 2X
then got java, then mysql-server-client, in stalled my program and thats it
 
Old 03-10-2011, 04:43 AM   #8
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Can I ask why you need the memory usage so high in the first place?
 
Old 03-10-2011, 04:55 AM   #9
woodzy
Member
 
Registered: Feb 2011
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by corp769 View Post
Can I ask why you need the memory usage so high in the first place?
shure you can. i run a game server called Minecraft, its a java based free build type of game u can find it at minecraft.net
 
  


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
100% memery usage in prstat Asteroid Solaris / OpenSolaris 3 11-03-2009 09:57 AM
USB memery strick not opening? Frank Soranno Slackware 8 06-05-2007 10:48 PM
grab bag of questions on memery use WebGraphics Linux - General 3 05-29-2007 04:14 PM
share dynamic memery between process dreamfly281 Programming 5 12-02-2005 12:37 PM
memery used by fprintf() lordofring Programming 2 09-14-2005 11:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:11 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration