Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
It's possible to free memory?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
LittleBug
Tux's lil' helper
Tux's lil' helper


Joined: 30 Mar 2005
Posts: 148
Location: 45°51'31.28"N, 12°15'11.73"E

PostPosted: Fri Jan 23, 2009 10:05 am    Post subject: It's possible to free memory? Reply with quote

Hi @ all!
Some time ago my 1GB RAM stick says me "So long and thanks for all the fish!" then die. From that I limited to use only 512MB :cry: !
Well! this is not a huge problem but when I launch emerge or heavyweight application, of course, free memory go down and when the program are closed free memory doesn't rise. After a while if I launch any other program system goning to swap and this is not very good!

My question is: "Is it possible to get out garbage that stay in RAM without any pourpose?"

Thanks!
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1477
Location: /uk/sheffield

PostPosted: Fri Jan 23, 2009 11:46 am    Post subject: Reply with quote

My understanding is that the kernel will free up memory when its requested unless its actually being used.

Thus when you close your heavy-weight application and it appears as though the memory isn't free you will find that if you start another heavy-weight application that requires the memory it will be available.

Memory is cheap, so grab some and get back to your previous levels (or even upgrade higher!).
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Jan 23, 2009 2:11 pm    Post subject: Re: It's possible to free memory? Reply with quote

LittleBug wrote:
when the program are closed free memory doesn't rise


that's cached. as mentioned above, the kernel will free up cache as needed when other applications request it.

If indeed you're seeing a fair bit of swap used, you're quite simply running out of memory.

If you really really really wan't to free up the cache:

Code:

echo 3 /proc/sys/vm/drop_caches



but i dont think that'll help - i think youre genuinely running out of memory
Back to top
View user's profile Send private message
AllenJB
Veteran
Veteran


Joined: 02 Sep 2005
Posts: 1285

PostPosted: Fri Jan 23, 2009 3:29 pm    Post subject: Reply with quote

You generally shouldn't need to worry about memory management at all.

A quick tutorial on reading free memory. Run "free", and you'll see something like the following output.
Code:

             total       used       free     shared    buffers     cached
Mem:       2060008     999632    1060376          0     339304     177132
-/+ buffers/cache:     483196    1576812
Swap:      1502068        156    1501912


The actual free memory here is that on the second line. The rest is used for buffers/caches which speed up operation and are freed as applications require the memory.
Back to top
View user's profile Send private message
iarwain
Apprentice
Apprentice


Joined: 25 Sep 2003
Posts: 253

PostPosted: Sat Jan 24, 2009 8:40 am    Post subject: Re: It's possible to free memory? Reply with quote

cach0rr0 wrote:

Code:

echo 3 /proc/sys/vm/drop_caches



You probably mean:
Code:

echo 3 > /proc/sys/vm/drop_caches
Back to top
View user's profile Send private message
LittleBug
Tux's lil' helper
Tux's lil' helper


Joined: 30 Mar 2005
Posts: 148
Location: 45°51'31.28"N, 12°15'11.73"E

PostPosted: Mon Jan 26, 2009 4:54 pm    Post subject: Reply with quote

Hi there, sorry for late but I had some connection problems!
Mmm ok you says that I shouldn't worry about free memory. I like Linux kernel a little more now!

Thanks for replies!
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Mon Jan 26, 2009 5:20 pm    Post subject: Reply with quote

Yes. There's nothing living resident on your ram after running emerge or whatever.

It's just cached memory, which essentially is the same than free memory. You just need to learn how to read the top/free output. If you really hit swap intensively then the reason is straight: you either need to choose lighter programs or heavier hardware. :p
Back to top
View user's profile Send private message
LittleBug
Tux's lil' helper
Tux's lil' helper


Joined: 30 Mar 2005
Posts: 148
Location: 45°51'31.28"N, 12°15'11.73"E

PostPosted: Tue Jan 27, 2009 11:19 am    Post subject: Reply with quote

I'm thinking to use BadRam patch into kernel with the hope my old 1GB ram are not too bad....

What do you think about?
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Tue Jan 27, 2009 5:31 pm    Post subject: Reply with quote

I know some people that uses this patch without problems. However the results are always dependent on the concrete hardware and the kind of damage. It's worth trying. If you experience instability or random crashes you can always take the bad module out again.
Back to top
View user's profile Send private message
jcat
Veteran
Veteran


Joined: 26 May 2006
Posts: 1337

PostPosted: Tue Jan 27, 2009 6:44 pm    Post subject: Reply with quote

I know it's all relative, but RAM is so cheap now, it rather than mess around with strange patches, I would just by some more :)



Cheers,
Just


Last edited by jcat on Fri Apr 10, 2009 8:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
LittleBug
Tux's lil' helper
Tux's lil' helper


Joined: 30 Mar 2005
Posts: 148
Location: 45°51'31.28"N, 12°15'11.73"E

PostPosted: Tue Jan 27, 2009 7:10 pm    Post subject: Reply with quote

Yeah! I know, RAM isn't expensive BUT mine, is an old system and DDR is more expensive than DDR2, (here in Italy, Stupid Italy) AND I suppose that my old 1GB RAM stick isn't totally screwed up (I hope); than as long as (the patch for) linux kernel (eheh linux rulez) give me this opportunity, why waste it? :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum