LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 05-21-2011, 08:59 AM   #1
amunro
LQ Newbie
 
Registered: May 2011
Posts: 16

Rep: Reputation: Disabled
Memory issue!


Hi, I run a minecraft server off a redhat server in a VM, and the past few days, I have been finding that something is eating my RAM! Im fairly new to servers in general, but after a few hours of googling, I noticed disk caching.

Anyway so long story short, i did free -m, and the output is:

Code:
             total       used       free     shared    buffers     cached
Mem:          2048       1606        441          0          0          0
-/+ buffers/cache:       1606        441
Swap:            0          0          0
Now I am fairly new to this as I say, but surely if it was the disk cache, the memory used for the Mem column and buffers collumn would be different. This suggests that it is a process. Now this is the strange thing, when i do 'top' command, i get this:

http://i54.tinypic.com/126fo88.jpg

Notice how the memory used is still far greater than what the processes use. The only thing I can think of, is that because I have screen installed, the server is opening twice for some reason, and that there is a second hidden javaw process. Anyway, please, I really need some help or advice on how to fix this. I have restarted the server many times, but I still find my memory usage is far greater than it should be when I start the java server!
 
Old 05-21-2011, 10:30 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Is this a VPS? What virtualization technology is your provider using? The only time I've seen 0 for buffers & cache is with .. OpenVZ, I think?

You have 441 MB free. I wouldn't worry about it until you get a lot closer to running out of RAM (I'd say until you start constantly swapping, but you don't seem to have any swap space .. another OpenVZ quirk?)
 
1 members found this post helpful.
Old 05-21-2011, 11:37 AM   #3
amunro
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Yes it is an OpenVZ redhat linux VM. Although I have 400mb free, I only have a 1gb guaranteed server, with 1gb burstable. I am just concerned about my server stability, and I have no idea what is taking up this extra chunk of ram! Could it be a ramdisk or something? I just want it fixed, because I was thinking of expanding and installing appache also.
 
Old 05-21-2011, 12:38 PM   #4
vkvs
LQ Newbie
 
Registered: May 2011
Posts: 23

Rep: Reputation: 2
It is perfectly fine for linux to consume all available RAM. It uses free RAM as CACHE, speeding startup of applications. You can check processes by "ps aux --sort rss" and see whats consuming RAM.
 
Old 05-21-2011, 12:42 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by vkvs View Post
It is perfectly fine for linux to consume all available RAM. It uses free RAM as CACHE, speeding startup of applications. You can check processes by "ps aux --sort rss" and see whats consuming RAM.
As you can see from the output of free, the OP's system is not caching at all.
 
Old 05-21-2011, 01:04 PM   #6
amunro
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
As you can see from the output of free, the OP's system is not caching at all.
Exactly my point! Something is using the RAM!
 
Old 05-21-2011, 03:07 PM   #7
amunro
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Anyone?
 
Old 05-21-2011, 03:29 PM   #8
amunro
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Here is an update:

http://i56.tinypic.com/68sz15.jpg

Getting worse :S
 
Old 05-21-2011, 04:37 PM   #9
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
This is a type of virtualization that uses and reports memory very differently from a non virtual or ordinary virtual system. You don't have your own instance of Linux running inside virtual "hardware". Instead you have an environment that is restricted to seeing only part of what is running under an instance of Linux that you share with others.

So most of what you see online about diagnosing memory issues does not apply to your situation.

In the top program you should sort by the RES column to see what is eating memory. One instance of Java appears to be half the problem (based on what you already posted). So you need to investigate what you are using Java for. Since Java is a very general purpose tool, it is unlikely to be a problem with Java itself and likely to be a problem in some application you have using Java.
 
1 members found this post helpful.
Old 05-22-2011, 09:49 AM   #10
amunro
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
This is a type of virtualization that uses and reports memory very differently from a non virtual or ordinary virtual system. You don't have your own instance of Linux running inside virtual "hardware". Instead you have an environment that is restricted to seeing only part of what is running under an instance of Linux that you share with others.

So most of what you see online about diagnosing memory issues does not apply to your situation.

In the top program you should sort by the RES column to see what is eating memory. One instance of Java appears to be half the problem (based on what you already posted). So you need to investigate what you are using Java for. Since Java is a very general purpose tool, it is unlikely to be a problem with Java itself and likely to be a problem in some application you have using Java.
That java instance is fine. It is the only process I want running on the server and I am fine with its RAM usage. I want the java instance to be taking up most of the RAM so the server is more stable. It is the other 1gb of RAM taken by another proccess that I want to kill
 
Old 05-22-2011, 12:33 PM   #11
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by amunro View Post
That java instance is fine. It is the only process I want running on the server and I am fine with its RAM usage. I want the java instance to be taking up most of the RAM so the server is more stable. It is the other 1gb of RAM taken by another proccess that I want to kill
You seem to have ignored

Quote:
Originally Posted by johnsfine View Post
In the top program you should sort by the RES column to see what is eating memory.
 
Old 05-22-2011, 02:38 PM   #12
amunro
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
You seem to have ignored
Yes, but my point was, add up everything in the res column, and it does not equal the memory used at the top
 
Old 05-22-2011, 02:42 PM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Top shows not all running processes. If you sort by Res you may get a better view on what is using the memory.
 
Old 05-22-2011, 04:05 PM   #14
amunro
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
Top shows not all running processes. If you sort by Res you may get a better view on what is using the memory.
Have you looked at the picture? The process does not show up at ALL on the 'top' command. Something is using up 1gb of pysical RAM and is not showing up!
 
Old 05-22-2011, 04:19 PM   #15
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Amunro -

Dude - you DON'T HAVE A MEMORY PROBLEM!!!!!!!!

And if you WANTED to "optimize" memory usage, the ONE process in question is Java.

Which, in your "top" output, is using 1.484GB virtual, and 860MB of resident memory.

You've got free RAM. You're using zero swap. Please LISTEN to what the others are trying to tell you. You have a Happy System. Relax. Chill

PS:
Two other suggestions to set your mind at ease:

1. As you've been told repeatedly, "top" doesn't show *all* processes - just the most *significant* ones. Here's a command to see all processes, sorted by Resident Set Size:
Code:
ps -eaF --sort=-rss
2. Investigate JConsole (or equivalent for your Java version):

Last edited by paulsm4; 05-22-2011 at 06:35 PM.
 
1 members found this post helpful.
  


Reply



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
Do I have a memory issue? DotHQ Linux - Server 5 10-28-2008 04:06 PM
Inactive memory issue, Freebsd (memory leak?) JasperB *BSD 7 08-12-2008 03:19 AM
Memory Issue? janetg SUSE / openSUSE 4 07-17-2006 08:16 AM
Memory issue jax79sg Programming 7 09-30-2004 12:14 AM
memory issue sachin_keluskar Linux - Hardware 1 07-27-2004 10:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:21 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
Open Source Consulting | Domain Registration