apcu icon indicating copy to clipboard operation
apcu copied to clipboard

Memory full, will clear memory? Rebuild?

Open condingyz opened this issue 5 years ago • 3 comments

condingyz avatar Sep 07 '20 06:09 condingyz

Yes, when memory runs full, memory is cleared.

nikic avatar Sep 07 '20 07:09 nikic

OK, does APCU have no elimination algorithm? If the cache is full, it will have some impact on the system.

condingyz avatar Sep 20 '20 10:09 condingyz

It does have garbage collection and removes expired entries, but the heap may be fragmented and it may be unable to allocate a large enough region, or there may simply be too much data. (it doesn't seem like it will move heap entries)

When it can't allocate a large enough continuous block for the data it'll clear memory.

Switching to a smaller serialization format such as igbinary/msgpack or allocating more shared memory can help make this less likely

TysonAndre avatar Nov 01 '22 13:11 TysonAndre