LinuxQuestions.org
Help answer threads with 0 replies.
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
 
LinkBack Search this Thread
Old 11-23-2004, 10:17 AM   #1
benne
Member
 
Registered: Sep 2004
Location: Iceland
Distribution: Gentoo
Posts: 44

Rep: Reputation: 15
Something is eating my memory


Howdy!

I just fired up cedega for the first time and it (i think it is cedega that is doing it) starts eating all of my memory and i cant get it back. According to the pricesses listed in ps and top, i should only be using a few % of my memory, but free -m tells a different story;

Code:
             total       used       free     shared    buffers     cached
Mem:          1009        998         10          0          9        260
-/+ buffers/cache:        728        280
Swap:         2055          0       2055
And I am not happy at all. I have tried killing lots of processes, shutting down X and loads of other stuff, but it stays put as it is.

Is it possible that there is some background process eating all of my memory? Can I list those in any way?

Cheers,
Benne
 
Old 11-23-2004, 11:02 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 65
See http://www.linuxquestions.org/questi...hreadid=257888
 
Old 11-23-2004, 11:27 AM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
this is not a problem -- you have no swapping going on !
so in a nutshell an operating system kernel that DOES NOT use up all you memory and leaves memory free for absolutely no reason is a kernel that is poorly designed.....

you have to stop looking at memory in the old way empty vs used
ALL memory in Linux is a virtual abstraction and each and every running process has 100% access to all of your RAM.
The only thing that actually is taking up space in you memory is some page mapping tables.
 
Old 11-23-2004, 12:54 PM   #4
benne
Member
 
Registered: Sep 2004
Location: Iceland
Distribution: Gentoo
Posts: 44

Original Poster
Rep: Reputation: 15
My swap is on and has been since i installed gentoo quite a while ago. And i have change swapiness to 100.
Code:
# echo 100 > /proc/sys/vm/swappiness
And the applications that were up (i shut down everything, inluding X, exepct a few server prcoseeses (sshd, apache, smbd/nmbd) simply can't take up 800 mb of ram. So i figured that maybe the harware was filling all the cache and all the memory so i unloaded the nvidia module and did "free -m" again, no change.
 
Old 11-23-2004, 03:34 PM   #5
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
you are missing what i say entirely (reread last post and let it soak in)
ALL MEMORY IS VIRTUAL AND ALL PROCESSES HAVE ACCESS TO ALL MEMORY ALL THE TIME !!!!!!!!!
then stop looking at "top"

Quote:
My swap is on
i mean
[qoute]
Swap: 2055 0 2055
[/quote]

no swap used = no swap needed = no pressure on memory

the kernel will only free memory when the system comes under pressure to need freed memory
and it will imediately get used again........

i have no idea why you think that when you close applications it should look like freed memory
what would be the point of it doing that ?????
 
Old 11-23-2004, 03:48 PM   #6
benne
Member
 
Registered: Sep 2004
Location: Iceland
Distribution: Gentoo
Posts: 44

Original Poster
Rep: Reputation: 15
Ok, I am a experinsed programmer so I know how memory is hadled, but unforunely i am quite new to linux (ive been using it for about a year now). Lets say a application needs lots of arrays. E.g. the arrays need 50 mb of memory. When the application quits, the arrays also quit, and therefor the data that they had in them, disappears from me beloved memory.

But are you saying that is is entierly ok. I have , now while im wrint, 167mb fee of 1 gb and i am merely doing anything (i have trouwn cedega out). Can't be. And my swap is active. And for some reason, nothings gets stored there.


Code:
             total       used       free     shared    buffers     cached
Mem:          1009       1001          7          0         15        141
-/+ buffers/cache:        843        165
Swap:         2055         64       1990
This is just riddiculus..
 
Old 11-23-2004, 04:26 PM   #7
benne
Member
 
Registered: Sep 2004
Location: Iceland
Distribution: Gentoo
Posts: 44

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by foo_bar_foo
i have no idea why you think that when you close applications it should look like freed memory
what would be the point of it doing that ?????
Just to make sure, is it OK for Linux to have only 10% of the memory free, that is, if it needs more memory, does it clean the mem to make space for the new stuff?
 
Old 11-23-2004, 04:27 PM   #8
butler
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Rep: Reputation: 0
You just don't get it. The kernel uses all spare memory as it sees fit. For things like caching to make the system faster... you are not out of memory.
 
Old 11-23-2004, 04:47 PM   #9
benne
Member
 
Registered: Sep 2004
Location: Iceland
Distribution: Gentoo
Posts: 44

Original Poster
Rep: Reputation: 15
Why cant it just put that part of the memory into the cache colomn in /proc/meminfo? And more important, why did this happen when i fired up that crappy cedega?
 
Old 11-24-2004, 11:35 AM   #10
benne
Member
 
Registered: Sep 2004
Location: Iceland
Distribution: Gentoo
Posts: 44

Original Poster
Rep: Reputation: 15
Alright i'll rewrite my question: How do I put pressuere on the RAM so it will swap the uneccesary stuff then? Beacsue it is getting really slow here, only 71 mb free right now.
 
Old 11-24-2004, 12:01 PM   #11
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
Ok... hold on. The reason you see linux take up a bunch of "memory" is it's write caching. Basically, when ever something is to be written to disk or whatever, instead of linux writing it directly to disk it will cache it in memory first. It then waits for a more opportune time to then write the data as well as speeds up your writes a lot. When running "free -m" the second line shows -/+ buffers/cache. This is your memory NOT including the cache of writes it has stored. This SHOULD be how much your programs are taking up, which also shouldn't be a lot. It's 70 MB used on my computer booted into X w/ firefox right now. Nowhere close to 700MB! (It is usually under 100 unless I'm playing games). I would suggest this as a good time to upgrade. Maybe some program had a bug/memory leak... Even an unstable driver your using.

Last edited by 95se; 11-24-2004 at 12:02 PM.
 
Old 11-24-2004, 12:25 PM   #12
benne
Member
 
Registered: Sep 2004
Location: Iceland
Distribution: Gentoo
Posts: 44

Original Poster
Rep: Reputation: 15
95se: Exactly my point, it cant be the kernel that has decied to eat my memory. If it would, then my computer would be faster, not slower. When i boot up, maybe ca 70-100 mb are in use. And after firng up som applications it maybe is about 140 mb in use.

I first though that the nvidia driver was leaking memory (since the MEM dissapered while playing a a game) but i shut it down, no change. I im running the newest nvidia-kernel and nvidia-glx modules (according to emerge)

Code:
*  media-video/nvidia-glx
      Latest version available: 1.0.6111
      Latest version installed: 1.0.6111
      Size of downloaded files: 15,138 kB
      Homepage:    http://www.nvidia.com/
      Description: NVIDIA X11 driver and GLX libraries
      License:     NVIDIA

*  media-video/nvidia-kernel
      Latest version available: 1.0.6111-r3
      Latest version installed: 1.0.6111-r2
      Size of downloaded files: 15,138 kB
      Homepage:    http://www.nvidia.com/
      Description: Linux kernel module for the NVIDIA X11 driver
      License:     NVIDIA
So doubt it is the nvidia driver. Time for a kernel update? Maybe.

Code:
*  sys-kernel/gentoo-dev-sources
      Latest version available: 2.6.9-r4
      Latest version installed: 2.6.8-r3
      Size of downloaded files: 35,607 kB
      Homepage:    http://dev.gentoo.org/~dsd/gentoo-dev-sources
      Description: Full sources including the gentoo patchset for the 2.6 kernel tree
      License:     GPL-2
Somehow i doubt that it is the kernel. Maybe it is just cedega that is fucked up. But it didnt leave any traces in ps -aux or top.

Last edited by benne; 11-24-2004 at 12:28 PM.
 
Old 11-24-2004, 04:21 PM   #13
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
Quote:
Originally posted by benne

This is just riddiculus..
yes this is riddiculus
just read about linux kernel
there are numerous papers on linux mem management
and if you know code the kernel code is open source
so i think you should not be posting about how it works this way or that way untill you at least understand how it actually works !!!!!!!
if you then have some problem with kernel developement take it up with the team -- sumbit fixes or alternatives -- or start a new kernel branch that works to your liking.....
you have confused mem allocation in c with kernel level page table management and allocation.

Quote:
Originally posted by 95se
The reason you see linux take up a bunch of "memory" is it's write caching. Basically, when ever something is to be written to disk or whatever, instead of linux writing it directly to disk it will cache it in memory first.
no this is not what the memory cache is that shows up in free !!!!
cache is about things read from the disk.

Quote:
How do I put pressuere on the RAM so it will swap the uneccesary stuff
there is rarely any reason to write data to a swap. Rather the data is just thrown out.....
if you must for some reason see swap use something like a video/audio editing program that stores lots of unique local data
and then ignores it for a long time and leave the program open don't close it..
also leave a bunch of other stuff running and ignore it for a long time and don't close them.
Then start up doing other stuff opening other programms etc and you wil see swap.
as the system tries to hold onto local data for the still open apps.

Quote:
Beacsue it is getting really slow here, only 71 mb free right now.
we have no idea why you equate 71mb free with "slow"
71mb free is exactly what will make often used applications start faster
(like cedega) or each time you start it do you actually want to set there and wait for it to load all those libraries instead of have it start right away ???????????? if that's the case then you will have to rewrite your kernel so it works all wrong. your cpu has a memory management unit that is 4gigs wide ! why not use it ?????
if you have problems with things running slow then tell us about those problems
ram problems often show up as unresponsive mouse or keyboard or frozen gui..
do you have those things going on ????
ok cedega is crap and slow we know that but i mean otherwise ???????
we also know most distributions run like crap out of the box but that is another issue as well.
 
Old 11-24-2004, 04:44 PM   #14
benne
Member
 
Registered: Sep 2004
Location: Iceland
Distribution: Gentoo
Posts: 44

Original Poster
Rep: Reputation: 15
Quote:
we also know most distributions run like crap out of the box but that is another issue as well.
Mine was never in a box, im running Gentoo, compiled and set up from stage 1. I configured the kernel (2.6 gentoo sources) to make it fit for my purposes. Tuned for my computer and I would definently NOT call my setup of gentoo crap.

Quote:
each time you start it do you actually want to set there and wait for it to load all those libraries instead of have it start right away ????????????
Note that i said that everything (like opening programs) is going relly slow. If libraires and stuff (for nearly a whole gb) are loaded in the memory, wouldnt that make the programs start FASTER, not SLOWER?

Quote:
ok cedega is crap and slow we know that but i mean otherwise ???????
I know it is crap. Now it doesnt exist on my system anymore. But why the *** should cedega decide that "hey this guy has 1 gb of mem, lets use it all". That must have loaded stuff that ONLY cedega needed into the memory and no other application. And it didnt clean it out of the memory like every other well behaving application would do. What is the point of that??

Quote:
[...] away ???????????? if t[...]
Whats up with all the question marks? Isnt one of them enough
 
Old 11-24-2004, 10:26 PM   #15
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
http://sourcefrog.net/weblog/softwar.../free-mem.html
http://sourcefrog.net/weblog/softwar...rnel/swap.html

you should use resources lke this and many others to figure out how linux is designed to work rather than bothering us

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Etch is eating up memory! Ptrs!OP Debian 22 07-16-2005 05:25 PM
Firefox eating into my memory masand Linux - Software 4 07-01-2005 04:23 AM
something's eating memory and i don't know what trancephorm Linux - Newbie 3 03-11-2005 02:39 PM
HELP ... Linux is eating my memory!!! don_dimo Linux - General 4 10-21-2003 11:23 PM
How do I see what's eating all my memory? thomas.nichols Linux - General 1 09-05-2001 09:19 AM


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