However, I'd appreciate it if you save your application suggestions/advice for a different question (re-architecting my application, using a different caching implementation, etc.). I do appreciate a good brainstorm, but I think this question will be most valuable if it stays focused on the technical specifics of how Memcached does and does not work. If you don't have the answer to this specific question, there is probably still value in what you have to say, but I'd guess that there's a different, better place to post the more speculative comments/suggestions/advice.推荐答案这可能是我们目前必须解决的最重要的内存缓存问题(无论如何,还是它的一种变体).This is probably the hardest problem we have to solve for memcached currently (well, a variation of it, anyway).释放一块内存需要我们知道a)该块中没有任何东西正在使用,并且b)在我们为重新使用/释放而对其进行清理的过程中,没有任何东西会开始使用它.我听说过一些关于如何解决平板再平衡问题的非常好主意,这些想法基本上是相同的,除了我们不试图释放内存,而是将其分配给其他东西(一些大型安装中的常见问题). ).Freeing a chunk of memory requires us to know that a) nothing within the chunk is in use and b) nothing will start using it while we're in the process of purging it for reuse/freeing. I've heard some really good ideas for how we might solve our slab rebalancing problems which is basically the same, except we're not trying to free the memory, but to give it to something else (a common problem in a few large installations).此外,免费是否真的减少了您的流程的RSS取决于实现.在很多情况下,malloc/fill/free会将内存映射在其中(除非您的分配器使用mmap而不是sbrk).Also, whether free actually reduces the RSS of your process is implementation dependent. In many cases, a malloc/fill/free will leave the memory mapped in (unless your allocator uses mmap instead of sbrk). 这篇关于Memcached守护进程可以在不终止进程的情况下释放未使用的内存吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 06:13