We use ccache-swig on small server used for CI compilations.
Stats reports that everything is ok.
]$ ccache-swig -s
cache directory PATH/.ccache
cache hit 18345
cache miss 17097
compile failed 5
preprocessor error 11
unsupported compiler option 21039
files in cache 2256
cache size 757.3 Mbytes
max cache size 976.6 Mbytes
But in reality
]$ du -hs .ccache/
1.7G .ccache/
Launching
ccache-swig -c
will solve the situation. But only for a little time. Some days later .ccache size will bypass the limit and stats will be wrong. Leaving this situation for a long period lead to have .ccache really big.
I'm not very familiar nor with ccache, not with compilation details. But this situation seems a little bit strange for me.
According to man the size should be fixed automatically :
When these limits are reached ccache will reduce the cache to 20% below the numbers you specified in order to avoid doing the cache clean operation too often.
So the questions :
- Is it normal (i.e. is it known issue? Is it normal behavior? )
- What could we do ? Launching "ccache-swig -c" regulary using cron ? It seems ugly for me (but well... it's still a solution).
Small Update : I forgot to give some information.
]$ ccache-swig -V
ccache-swig version 4.1.0
Copyright Andrew Tridgell 2002
Released under the GNU GPL v2 or later
And we are on RockyLinux9 (but this behavior was observed also on CentOS 7 servers).