3 ms·
I can't answer for everyone, but I can tell you why I have a cron job dropping my cache every several minutes: The application I develop consumes most of the r
by jrkatz 13y ago
I can't answer for everyone, but I can tell you why I have a cron job dropping my cache every several minutes:
The application I develop consumes most of the ram on my machine when running, and takes several minutes to rebuild and start up to begin with. When most of my memory is being used for the cache, this process takes several minutes longer, because I'm making millions upon millions of calls for more memory -- and each one has to get some of that cached memory back for itself. If I simply drop the cache all at once, every minute, it takes a split second. If I shrink it over a million increments, it takes around a minute.
Even typing that I feel I must be doing something wrong; and yet, it worked.
- deathanatos 13y agoYour app is making more calls to malloc when there is memory being used by disk cache, or you mean something else by "millions upon millions of calls for more memory"? You control hope many times you call malloc. Just call it once with what you need.