Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I have a memory problem
PC = 800MHz 128MRAM. RedHat 7.3
If I start my computer (without X) there are 30 MRAM used.
I start my java application which take 31 MRAM --> 30+31 = 61MRAM, this is OK.
But if I check after 2 days, the memory used by my application is always the same and the number of proccess is the same but
there are only 2MRAM free. My application is in the swap and become very slow. I don't know what is using the memory!!! I'm
working in level 3 and there are no special configuration.
Distribution: Emacs and linux is its device driver(Slackware,redhat)
linux uses the free ram but when another application try to get memory space kernel gives the enough mem to the application when you close a application kernel does not clean the memory complete in case you run that application again you check this run mozilla for the first time it takes 5 10 second depending on the system close it and run it again it will lauch much faster for the second time but the memory that is not clean will be cleaned if another program need memory
Ok I use "top" and "free" to check the memory. The cache file size is increased. The question is, what is the utility of this cache file (sorry but I'm a newbies) and can I get back the memory free.?Because I don't want to send my application in the swap.
Memory will be used for cache when its not being used elsewhere, there's no facility for you to force the cache to be reduced to free-up physical memory the kernel manages all this for you. A lot of time and effort goes into memory management, if swap is being used then its being used to hold items that are not being used with any frequency, so the memory they would occupy is best put to other uses (buffers and cache). The cache is just used as temporary storage to speed up disk accesses.
As your swap is on the hardd isk you can't use that to cache hard disk accesses!!
I've never seen any options to effect such things, you just leave the kernel to it. Unless you've spent many years looking into memory management you're not going to do it better than the kernel already does.
Is your machine thrashing a lot or are you getting other performance issues? Unless it really thrashing due to non-stop swapin/swapout operations then it's not going to be memory management related, Java over X is always a bit 'interesting' in my experience.
as jharris said; linux uses ram efficiently, using it for caching and
releasing it to apps when they need it. you would not want
this caching to be done on hdd; since hdds are much slower
than ram. in short: memory is there to be used; so why would
you want it to be free an unused?