Memory management
Does anyone know a good way to free up some of your memory in linux. Most of the time i'm using 90% of my physical memory and 0% swap space. I've disabled programs I dont need plus i added 256mb of ram the other day and it just ate it up.
|
Try running "top" and pressing "M" to sort by memory usage. it sounds like you may be running a program with a memory leak if it ate up all the new 256.
|
How much of the memory used is cache?
I have a 1GB of RAM and Linux still uses 90% even though only about 128MB is actual programs the rest is cache. Linux will store as much as it can in memory to speed things up. HD access takes forever compared to memory. So no matter how much memory you have Linux will try to use almost all of it. It's a really nice system and it speeds up things alot. OTOH it is a good policy to not run anything you don't need. You can take a look at ps aux to give you an idea about what programs are running. Then you can remove anything you don't use from your init scripts. |
Memory Leak?
I think I may be having some sort of memory leak.
I'm running RH8 with all the current updates from up2date. 1gb in memory dual amd 2gig processors. The system for the most part sits idol. If I count all the memory allocated to programs I get somewhere in the 200-300 range. Yet I'm at 95% used. Programs and Services: Gnome, wget (daily backup from main server), apache, iptables, php with optimizer, mysql, pretty much everything from a full install. Anyhow, is there a way to test for memory leaks or perform some sort of flush/refresh? Thanks. ---------------------- I'm no expert, but i know not to type rm -rf / |
|
Alright, so I thnk this shows that cache is eating me up.
This is not a healthy process for because when memory is full it slows performance. Here are the two commands.. [root@vacant init.d]# cat /proc/meminfo total: used: free: shared: buffers: cached: Mem: 1055326208 1028231168 27095040 0 62836736 860737536 Swap: 2146787328 123543552 2023243776 MemTotal: 1030592 kB MemFree: 26460 kB MemShared: 0 kB Buffers: 61364 kB Cached: 803124 kB SwapCached: 37440 kB Active: 764212 kB ActiveAnon: 66208 kB ActiveCache: 698004 kB Inact_dirty: 1612 kB Inact_laundry: 147316 kB Inact_clean: 17052 kB Inact_target: 186036 kB HighTotal: 130992 kB HighFree: 7652 kB LowTotal: 899600 kB LowFree: 18808 kB SwapTotal: 2096472 kB SwapFree: 1975824 kB [root@vacant init.d]# free total used free shared buffers cached Mem: 1030592 1007092 23500 0 61368 803140 -/+ buffers/cache: 142584 888008 Swap: 2096472 120648 1975824 |
Have you read the article I linked???
|
Yes, it is helpful understand the two commands you gave me. Obviously, what i see is that cache is growing so large that it leaves the system unstable to handle any new processes.
Is there a way to limit cache and buffer from eating all available system memory? |
Are you having lots of disk activity?
From the article: Quote:
Code:
fancy@uilleann $ cat /proc/meminfo Code:
fancy@uilleann $ cat /proc/meminfo |
That would be great, but instead of leaving 295MB free for immediate use. It only leaves 23MB free. This makes bring up Mozilla or using X in general slow in response. The system has even completely frozen on me a couple of times.
|
What did top (memory sorted hit shift m) show for your processes?
Code:
2:20pm up 27 min, 4 users, load average: 1.68, 1.14, 0.55 |
Top memory was fine, it was simply cache/buffer had taken up all the space. It matters not that computer since I was 'let go' from there the other day.
But I know on other systems I've worked with having the same trouble. What I think I see perhaps is with the Hard Drive cached, when I run certain programs that demands a lot of memory at once. It either has to swap my active program in Swap-space, or it has to determine what is in its cache to keep and what to discard for space. I wonder if in theory you don't want to have unused memory. but in practice to much cache/buffer can actually cause system lag. |
All times are GMT -5. The time now is 04:35 AM. |