Unlimited caching on Linux results in long simulations hitting swap
1 Attachment(s)
Hello,
I am currently running some simulations as part of a parameter sweep on a modest Linux workstation (20-core, 128GB RAM, OpenFOAM 4.x on OpenSUSE Linux 42.2 Leap). I should probably also note that I'm running these simulations through PyFoam, maybe that makes a difference. I've noticed that as one of my simulation progresses, cached memory seems to keep going up. I've checked the cached memory usage on my machine using Code:
fincore I used to set the 'purgeWrite' option to 0 and just hold on to everything, but even when I set that to something like 5, it still keeps growing. At the time time of writing, I have about 4 GB of cache - most of which isn't needed. But this isn't ideal. There are cases when I want all of the resulting output data, but only on disk. When I didn't use the purgeWrite option, a simulation using a anywhere between 5-10 GB ended up using 60-80GB of cached memory before I cleared it using the following command: Code:
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches' Has anyone else dealt with this before? And if so, what is the proper way of dealing with this? Code:
filename size total_pages min_cached page cached_pages cached_size cached_perc |
Quick answer: https://www.cfd-online.com/Forums/op...too-large.html
---- Edit: Sorry, I read your post too fast and mixed up information while I was moving several threads about PyFoam. I've had this issue in the past, namely that the cache would not flush automatically and it would end up going into the Linux swap. The problem is that I never figured out what exactly got broken and that resulted in this. The fix that has always worked was to simply do a cold reboot of the machine in question (safely/normally shut it down and turn it back on after a minute or so). After that, I was never able to reproduce the same error for isolating the problem. My guess is that there was some bad memory access by some library or application, which resulted in the cache management system to go nuts and do this. On the other hand, whenever it does not reach swap, then caching files should not hurt anything, since it's only caching for possible future re-reading of the read and/or written files. Technically, the files should be safely written to disk. |
All times are GMT -4. The time now is 10:44. |