LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 07-30-2009, 01:22 AM   #1
sreeharsha.t
Member
 
Registered: Jan 2009
Location: Mumbai, India
Distribution: Fedora 9, 10,11, RHEL 5
Posts: 67

Rep: Reputation: 18
Question Strange Memory Usage


Recently I was investigating why one of our servers which has 6 GB RAM was showing only 60MB free memory. I was shocked to find that some processes are occupying memory in Gigs (I would rather say in Tera Bytes).

Check the attached screen-shot:

memory.png

This is not possible, practically, as our Server doesn't have that much space, neither as RAM nor as SWAP.

Any Idea of why this happens?

PS: The server is running on Xen Dom 0 Kernel and hosts two Xen Dom-u hosts.

Last edited by sreeharsha.t; 07-30-2009 at 01:23 AM.
 
Old 07-30-2009, 05:30 AM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,902

Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
well, superficially, it looks as if you have stumbled across a bug in the Gnome monitor tool when reporting large numbers. It may have something to with Xen and the way that it is set up, but I don't know anything about that.

It would be sensible to look at the other tools available, to see whether they report similar numbers (top, htop, ksysguard and probably loads of others).

This is a server and you have gnome installed and are using it? Ho, hum.
 
Old 07-30-2009, 06:45 AM   #3
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,087

Rep: Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110
The incorrect value is obviously a 64 bit value. Is this a 64 bit system where the memory size should be 64 bit? Or is it a 32 bit system?
Either way, the displayed value is a bug, but the nature of the bug would depend on the system bit size.

If you convert the wrong value to hex, the high 32 bits are apparently text. They have the value "in b".

So I expect

1) The system is 64 bit.
2) The program (Gnome monitor tool) has some unintended assumptions that are only valid in 32 bit.
3) It accidentally combined a 32 bit value for memory size with whatever was left over in the next 32 bits of memory from some previous operation (that "in b") to produce a garbage value.

It wouldn't have anything to do with the actual value that is correct (so not "when reporting large numbers" as salasi guessed). It is much more likely to be an error in a stack variable so it depends on some unrelated result in an immediately preceding operation (preceding operation inside the tool as it gathers info about processes, not preceding from a user point of view).

From a programmer viewpoint, it is probably use of an int or unsigned int in some place that should have used size_t. But that alone shouldn't be able to cause this symptom, there must also be some questionable cast operation. Personally, I use a lot of questionable cast operations. I just always think through all the potential consequences.

Edit: I just ran gnome-system-monitor on a 64 bit Centos 5.3 system and I see the same bug, but with different values, not the 6585170340.5 that the OP saw and significantly, I see different values on different processes. I also see the problem goes away fairly quickly as the program continues to run. It comes back randomly as other people start and stop programs and it comes back as I resize the System Monitor window. But it doesn't come back spontaneously when nothing is changing. This is version 2.16.0 of gnome-system-monitor. I might look at the source code later to see if the bug is obvious. But first I ought to check whether it is already fixed in some later version. I don't know which, if any, later versions could be installed/run in Centos 5.3 without generating a dependency mess.

Last edited by johnsfine; 07-30-2009 at 08:41 AM.
 
Old 07-30-2009, 02:06 PM   #4
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,087

Rep: Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110
I was on a Mepis computer at lunch time just long enough to get Synaptic to install whatever version of gnome-system-monitor is current in 64 bit Mepis 8 and to test that.

I didn't see any failure similar to the ones I saw with version 2.16.0 in Centos 5.3.

That gnome-system-monitor (in Mepis 8.0) was a much newer version (but at the moment I forget the number) and clearly very enhanced since the version in Centos 5.3. So I suspect the bug has been fixed (rather than it just isn't triggered by the set of processes on my Mepis system).

If the OP, is still interested, you might want to download source for a newer version of gnome-system-monitor and build and/or download binaries for it from Fedora.

I generally like the stability of Centos, but sometimes you want to use a program where they are too far behind important developments. I don't know how practical it is to get one program from Fedora out ahead of the rest of your RHEL or Centos system, but I suspect it isn't practical. We usually rebuild locally from source when the Centos copy of an individual program is too far out of date.
 
Old 07-31-2009, 01:58 AM   #5
sreeharsha.t
Member
 
Registered: Jan 2009
Location: Mumbai, India
Distribution: Fedora 9, 10,11, RHEL 5
Posts: 67

Original Poster
Rep: Reputation: 18
Thumbs up

Quote:
Originally Posted by salasi View Post
It may have something to with Xen and the way that it is set up, but I don't know anything about that.
From what johnsfine said, it doesn't appear it has got something to do with Xen.

Quote:
Originally Posted by salasi View Post
It would be sensible to look at the other tools available, to see whether they report similar numbers (top, htop, ksysguard and probably loads of others).
The other tools reported the correct memory values.

Quote:
This is a server and you have gnome installed and are using it? Ho, hum.
This server is in Dev env, so we use gnome to speed up things.




Quote:
Originally Posted by johnsfine View Post
So I expect

1) The system is 64 bit.
2) The program (Gnome monitor tool) has some unintended assumptions that are only valid in 32 bit.
3) It accidentally combined a 32 bit value for memory size with whatever was left over in the next 32 bits of memory from some previous operation (that "in b") to produce a garbage value.
This is a 64 bit system and I agree with your inference on this program's behaviour.

Quote:
Originally Posted by johnsfine View Post
If the OP, is still interested, you might want to download source for a newer version of gnome-system-monitor and build and/or download binaries for it from Fedora.
I shall try to do that. Alternatively, I checked the gnome-system-monitor in Fedora 10 on another 64bit machine and it seems that the bug was fixed in it. I am presently not at that computer and can post the version of it soon. The one which is having this problem (bug) is of version 2.16.0.
 
  


Reply

Tags
memory


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
Strange httpd memory usage TTiZ Linux - Server 1 05-25-2007 08:19 AM
X hangs after prolonged usage ... memory usage goes upto 195MB duryodhan Slackware 18 05-10-2007 06:16 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM


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

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