Support Christine Media Player

Christine

Recent Comments On Blog

Memory limit for a single user

Yesterday night, chatting with maop he ask about how to clean the memory in linux, I ask what about what he means about "cleaning", he said "free all the memory used by cach??????©", Well, in some way is a nice question that I make to myself some months ago, "Why is allways used all my RAM if I have 528MB?", google points me to some page wich solve my question: "Cache", yes, most of my RAM is used for cache, why?, well, is easier and faster for linux to load chunks of programs from the cache instead loading from the disk, so if you have firefox opened you can open a new window faster than the first time, even if you close firefox it will open faster.

Then, cleaning the cache is not a good idea, but, maybe you want to do it just to do it. Well, Cache is still there until Linux "thinks" that it will not be needed anymore (like swap pages) or when more resident memory is needed. Then you can
  1. Wait until your cache is automaticly cleaned, or
  2. Launch a memory eater program
The second is faster, but may slow down your system like a turtle, and if you don't take care it may crash your system. There is where raise another question : How to limit the memory usage per user?.

I use my "memory eater" program yesterday and I almost crash my system, as a single user!!, what if I where using a server with several users connected?. I mean, is there something like Quota but for RAM?.

If you want to check it compile this and run it as a single user:

#include < stdlib.h > int main(void){
                while (1){
                        malloc(150);
                }
}
 

#1 Re: Memory limit for a single user

MaoP, <E-Mail> / Thursday 17 August 2006 4:28pm  
avatar

Haha, nice!
you should stay a little more yesterday:

22:42 < markuz> maop, ps ahi va, pero medio lenton
22:43 < markuz> no mames.. la memoria se me lleno, se libera hasta que terminas con python
22:43 < markuz> ta mas shido el mio, te bloquea la maquina mas rapido tongue.png 22:43 < markuz> wen
22:43 < markuz> weno
22:44 < markuz> ahi se ven.
22:44 < markuz> c-ya
22:44 -!- markuz [n=markuz_at_189_dot_128_dot_45_dot_201] has quit ["Leaving"]
22:46 < maop> no mams
22:46 < maop> te limpia bien chido la memoria
22:46 < maop> tienes que reiniciar xD
22:47 < el_choya> he,he
22:47 < maop> se el_choya
22:47 < el_choya> que onda mi maop
22:47 < maop> aca arranando maquinas
22:48 < maop> a ver, eso no me gusto, vamos a arreglar el ulimit

Yep, you can set with ulimit a lot of things like maximum memory, max open files, max cpu time, and so... just type ulimit -a , and play with it.

cheers...

[ Reply (0) ]

#2 Re: Memory limit for a single user

markuz, <E-Mail> / Thursday 17 August 2006 5:52pm  
avatar

gunnar says the same to me, Well, then, there it is face-smile-big.png . ulimit.

[ Reply (0) ]

Leave a Comment

Write the captcha code you are seeing.

Comment XML feeds: RSS | Atom

Visitors Statistics

5
733
595329

Technorati