LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   My ram is draining, dont know why. (https://www.linuxquestions.org/questions/linux-newbie-8/my-ram-is-draining-dont-know-why-4175475929/)

oldassgamers 09-04-2013 04:58 PM

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?

astrogeek 09-04-2013 05:04 PM

Quote:

Originally Posted by oldassgamers (Post 5021837)
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!

haertig 09-04-2013 05:17 PM

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.

oldassgamers 09-04-2013 06:42 PM

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?

haertig 09-04-2013 06:55 PM

'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.

astrogeek 09-04-2013 07:09 PM

Quote:

Originally Posted by oldassgamers (Post 5021904)
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.

unSpawn 09-04-2013 07:14 PM

...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.

oldassgamers 09-04-2013 07:22 PM

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.

oldassgamers 09-04-2013 07:25 PM

Quote:

Originally Posted by unSpawn (Post 5021922)
...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.

unSpawn 09-04-2013 07:33 PM

Quote:

Originally Posted by oldassgamers (Post 5021928)
So how do you limit the ram usage of that command for java.

As I said you don't.


Quote:

Originally Posted by oldassgamers (Post 5021928)
how to write it?

Depends on wherever your application is. Could look like 'java -Xmx1G /path/to/file.jar'.

oldassgamers 09-04-2013 07:38 PM

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?

unSpawn 09-07-2013 03:12 AM

Post all of
Code:

free -hlmt; swapon -s; top -b -n1

273 09-07-2013 03:22 AM

Are we sure this isn't a case of Linux ate my RAM?


All times are GMT -5. The time now is 03:55 AM.