Hi,
Interresting link, but doesn't anwser. Let me rephrase my question.
1. From the 'top' result I've 8GB (8126148k total) of physical memory, and half of it (4103596k cached) is used for filesystem cache. is that right ?
2. I experience swapping because I use more memory than physical ones. in fact, there are several Oracle instances and the total of memory allocation is near 8GB
I expected that before swapping, the system should try to use the physical memory that is used for cache (i.e the 4GB). Am I missing something ?
Thanks a lot. I forgot to check swappiness . I will do it when I'm at the customer again next week.
just one additional precision, please: what is the best way to see - before the system starts swapping - if are low on physical memory.
I used to consider 'free' + 'buffers' + 'cached' but obviously, for the reason you gave me, it's not right. Monitoring page in/out will probably alert alert too late. Is there sonething else ?
I can't actually see a problem from the reports you posted - I don't see any change at 09:50, though I/O stats might show something if the system is really paging/swapping.
Oracle uses shared memory, so adding up the memory usage reported by `ps` will overestimate the amount actually used. You need to look within Oracle to see how it is using that memory - and if the system is mainly used for Oracle, consider increasing the SGA size so Oracle can manage its own caching.
I believe the 6GB of swap "used" is reserved in case the system _needs_ to swap rather than actively in use. As you know, the "cached" figure should be part of the previous line, Mem stats.
`sar -B` shows a peak at 10.20, but it could be a new process pulling data in.
Also, how do the stats compare to your "benchmarks"? e.g Mem usage after a reboot & starting Oracle, plus normal, low and high usage?
Franck Pachot
ASKER
@seth2740,
free or top will show physical memory usage
It show physical memory used. But part of it is used only because it is not needed for processes. How to know that part ?
Well I'll post the question again in a new thread.
@tfewster,
Thanks. Yes I'm aware that ps reports the shared memory for each process.
But I'm sure that SGA was above the physical memory and I'm sure the system was swapping at that time (system very long, kswapd busy) for at least 5 minutes around 09:50
What I did not understand was why it did not reclaim space from the filesystem cache.
Aha, that's a different symptom. Search online for "kswapd high CPU". It's a known bug, and you should consider a kernel update.
I still suspect that, from the stats you posted, the system wasn't swapping and so didn't need to reclaim the memory used for cache.
Good luck!
Franck Pachot
ASKER
Sorry, but the system was swapping. When you are on a system that starts swapping a lot when you do something that needs to read a large portion of memory, you know that it is swapping. No doubt... Operation was an Oracle Statspack snapshot level 7 ... reading lot of things from shared pool.
My doubt was about why that memory was swapped.
The answer from seth2740 makes sense: that part of memory was probably idle for a long time (low activity on the instance before I arrived) and the system preferred to keep data in cache because of swapiness.
I'll update this thread on tuesday when I'll check swapiness value.
Franck Pachot
ASKER
Hi,
Jus a not to confirm that it was due to swappiness that was high:
https://www.experts-exchange.com/questions/27967317/Redhat-Linux-swap.html
Does that answer your question as well?