LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-04-2013, 05:58 PM   #1
oldassgamers
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Rep: Reputation: Disabled
My ram is draining, dont know why.


Hello guys, I'm very noobish in linux. I've used it for three days and learned alot of commands.

I purched a vps server for my teamspeak 3 server. The server is using debian 7.0

The only thing I want it to do is to run my teamspeak 3 server with java installed because I got a bot on my server which does alot of great task.

The issue I have, is that the vps server is losing mb per hour. So out of 2012mb, I only have 994mb and it's steady droping. Can't figure out what's eating the ram.

I've installed oracle java for linux and also screen.

I wrote free -m to see my ram and it slowly drains. So then I wrote top command and I see the VIRT ram and its still the same for java + teamspeak3server. Java is at 811m and teamspeak 3 is at 209m on VIRT.

So can someone give me suggestions on how to solve why it's draining all the time? Do you think I've installed wrong java and what java do you guys recommend for me to use on debian linux?

Last edited by oldassgamers; 09-04-2013 at 06:01 PM.
 
Old 09-04-2013, 06:04 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,876
Blog Entries: 1

Rep: Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998
Quote:
Originally Posted by oldassgamers View Post
The only thing I want it to do is to run my teamspeak 3 server with java installed because I got a bot on my server which does alot of great task.
Actually, from the info you posted it sounds like pretty normal RAM usage, you will need to be more clear on why you think it is 'draining'. Is it causing some kind of problem?

Also, does your mystery bot use ram for storing whatever it does? If so, that will represent an ever increasing chunk of RAM as well.

BTW - Welcome to LQ!

Last edited by astrogeek; 09-04-2013 at 06:14 PM.
 
Old 09-04-2013, 06:17 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,115

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Quote:
My ram is draining, dont know why.
You should see a urologist about that.

Java is a well-known resource pig. It is not unusual for a Java program to eat everything in sight, and still go looking for more. You don't have to know much about what you're doing to write in Java. Which is why there are so many ill-behaved Java programs out there.
 
Old 09-04-2013, 07:42 PM   #4
oldassgamers
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for reply. I'm super noob in linux. The only thing I know what's running becide the "original package" when starting up debian linux, is the teamspeak 3 server and java.

So is there any command to investigate why the ram is slowly draining by something. It should say right? in the top command?

and what linux package for java should you I use?
 
Old 09-04-2013, 07:55 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,115

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
'top' will tell you what process is using the memory. It won't tell you why. Typically if a process is grabbing more and more memory over time, and never releasing it, the reason is "poorly written program". Not much you can do about that other than find an alternate program or write a better one yourself.
 
Old 09-04-2013, 08:09 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,876
Blog Entries: 1

Rep: Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998
Quote:
Originally Posted by oldassgamers View Post
So is there any command to investigate why the ram is slowly draining by something. It should say right? in the top command?

and what linux package for java should you I use?
Well, first of all you are using the word 'draining' for 'using', as if you think that ram being used is a bad thing - it is not. The kernel and running programs together will manage available ram as a resource to (usually) get the best benefit from it. If using more ram will help some operation, and no other program is using it at the time, the kernel will allocate more ram to it... this will typically continue until the majority of the ram is "in use". That is not a bad thing.

If another program needs ram it will ask the kernel. The kernel will determine how much of that "in use" ram can safely be freed for use by another program and re-allocate it accordingly. This is a central function of the kernel.

But the ram is not draining away from the system or becoming inaccessible - it is being used, which is why it is there.

So, unless you are experiencing some problem resulting from the ram being in use, there is no problem.

So I ask my original question again, are you experiencing a problem from the ram usage?

And as to the java package, probably the latest available from the distro's package repos is the one you should be using.

Last edited by astrogeek; 09-04-2013 at 08:12 PM.
 
Old 09-04-2013, 08:14 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
...additionally Java doesn't regard memory like well-behaved native Linux applications would. For example trying to limit max mem with say "-Xmx1G" doesn't really mean 1 GB is all the system memory Java will use. Unfortunately until you found an alternative or know how to tune Java more RAM is the only thing that'll work.
 
Old 09-04-2013, 08:22 PM   #8
oldassgamers
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
I write top command and it shows the following:
PID USER PR NI VIRT RES SHR S CPU MEM TIME+ COMMAND
6592 ts3serve 20 0 209m 29m 6132 S 6.7 1.5 119:30.83 ts3server_linux
8345 root 20 0 811m 44m 9.8m S 1.0 2.2 13:30.91 java

209+811=1020

When writing free -m I get 989mb free memory. But when doing this command 3 hours ago I had 993mb free memory and then the value for ts3 and java was exaclly the same.


Thanks for all your answers and explanations.
 
Old 09-04-2013, 08:25 PM   #9
oldassgamers
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
...additionally Java doesn't regard memory like well-behaved native Linux applications would. For example trying to limit max mem with say "-Xmx1G" doesn't really mean 1 GB is all the system memory Java will use. Unfortunately until you found an alternative or know how to tune Java more RAM is the only thing that'll work.
So how do you limit the ram usage of that command for java. how to write it? The java file that is in usage is java.
 
Old 09-04-2013, 08:33 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
Quote:
Originally Posted by oldassgamers View Post
So how do you limit the ram usage of that command for java.
As I said you don't.


Quote:
Originally Posted by oldassgamers View Post
how to write it?
Depends on wherever your application is. Could look like 'java -Xmx1G /path/to/file.jar'.
 
Old 09-04-2013, 08:38 PM   #11
oldassgamers
LQ Newbie
 
Registered: Sep 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
I wrote dpkg -- list and found the java installer and removed it + config. then i killed the java process with the bot for teamspeak 3. Now I got 1355mb ram out of 2000mb.

But in top command I only see 209mb usage? So how do I figure out where the rest ram is going to?

Last edited by oldassgamers; 09-04-2013 at 09:01 PM.
 
Old 09-07-2013, 04:12 AM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
Post all of
Code:
free -hlmt; swapon -s; top -b -n1

Last edited by unSpawn; 09-07-2013 at 04:14 AM.
 
Old 09-07-2013, 04:22 AM   #13
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,004

Rep: Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620Reputation: 1620
Are we sure this isn't a case of Linux ate my RAM?
 
  


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
Why size of swap space is 2x of RAM??? Why not 1.5x of RAM or 2.5x of RAM??? Saurav Ghosh Linux - Newbie 7 11-01-2011 04:49 AM
timeout waiting for input during Draining Input HammerHed Linux - Newbie 1 11-01-2008 06:35 AM
Sendmail: timeout waiting for input from local during Draining Input andrewstr Linux - Software 0 07-14-2004 02:43 PM
new to linux dont what distro to use dont no much command xman2007 Linux - Newbie 3 01-02-2004 06:32 PM
Things dont work when you dont understand withoutaclue Linux - Newbie 3 03-12-2003 10:51 AM


All times are GMT -5. The time now is 12:59 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