Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
05-21-2011, 09:59 AM
|
#1
|
LQ Newbie
Registered: May 2011
Posts: 16
Rep:
|
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!
|
|
|
05-21-2011, 11:30 AM
|
#2
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824
|
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.
|
05-21-2011, 12:37 PM
|
#3
|
LQ Newbie
Registered: May 2011
Posts: 16
Original Poster
Rep:
|
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.
|
|
|
05-21-2011, 01:38 PM
|
#4
|
LQ Newbie
Registered: May 2011
Posts: 23
Rep:
|
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.
|
|
|
05-21-2011, 01:42 PM
|
#5
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Quote:
Originally Posted by vkvs
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.
|
|
|
05-21-2011, 02:04 PM
|
#6
|
LQ Newbie
Registered: May 2011
Posts: 16
Original Poster
Rep:
|
Quote:
Originally Posted by TobiSGD
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!
|
|
|
05-21-2011, 04:07 PM
|
#7
|
LQ Newbie
Registered: May 2011
Posts: 16
Original Poster
Rep:
|
Anyone?
|
|
|
05-21-2011, 05:37 PM
|
#9
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
|
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.
|
05-22-2011, 10:49 AM
|
#10
|
LQ Newbie
Registered: May 2011
Posts: 16
Original Poster
Rep:
|
Quote:
Originally Posted by johnsfine
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
|
|
|
05-22-2011, 01:33 PM
|
#11
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
|
Quote:
Originally Posted by amunro
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
In the top program you should sort by the RES column to see what is eating memory.
|
|
|
|
05-22-2011, 03:38 PM
|
#12
|
LQ Newbie
Registered: May 2011
Posts: 16
Original Poster
Rep:
|
Quote:
Originally Posted by johnsfine
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
|
|
|
05-22-2011, 03:42 PM
|
#13
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Top shows not all running processes. If you sort by Res you may get a better view on what is using the memory.
|
|
|
05-22-2011, 05:05 PM
|
#14
|
LQ Newbie
Registered: May 2011
Posts: 16
Original Poster
Rep:
|
Quote:
Originally Posted by TobiSGD
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!
|
|
|
05-22-2011, 05:19 PM
|
#15
|
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Rep:
|
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 07:35 PM.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 02:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|