[Question] About vectorCacheMaxObjects mechanism

Hi, I have a question about vectorCacheMaxObjects. It seems that the memory held by weaviate can be controlled by vectorCacheMaxObjects. Is this a queue-like structure where vectors are updated in the most recent order? Also, I’m curious about the process of which vectors are prioritized in memory when the weaviate server is rebooted.

I’m also curious about how weaviate’s memory is driven, because once it reach the maximum memory limit set in kubernetes, it won’t be able to create any more caches, and I’m wondering how weaviate behaves in that case.

And finally, if I want to limit the maximum size of memory that the weaviate server can hold to 24 gigabytes (not by the number of vectors), I’m wondering if there are other arguments I could utilize.

hi @jaehyoyoo !!

Welcome to our community :hugs:

Considering our docs on that subject, indeed vectorCacheMaxObjects has a direct impact on memory usage.

If you have more objects than vectorCacheMaxObjects, a disk lookup will be necessary, making your database less performant.

When you restart, Weaviate will fill in that cache, so following searches will be faster. Whenever that cache fills up, Weaviate will drop it, and start replacing it as requested.

If you want to control the memory Weaviate uses at the memory level, you need to change the value of GOMEMLIMIT, as described here:

We have this nice article that do a deep dive into GOMEMLIMIT in Weaviate:GOMEMLIMIT is a game changer for high-memory applications | Weaviate

Let me know if this helps!

Thanks!