xi-db opened a new pull request, #50530: URL: https://github.com/apache/spark/pull/50530
### What changes were proposed in this pull request? Currently the ML Cache is limited by the number of cache entries (100 entries at this time), but it is not ideal because model size varies. In this PR, we are updating the MLCache model eviction policy to be memory based, i.e. to evict old models if the total size is greater than a limit. Besides, two new internal Spark confs are introduced: * `spark.connect.session.connectML.mlCache.maxSize`: Maximum size of the MLCache per session. The cache will evict the least recently used models if the size exceeds this limit. * `spark.connect.session.connectML.mlCache.timeout`: Timeout of models in MLCache. Models will be evicted from the cache if they are not used for this amount of time. ### Why are the changes needed? This improve the memory management of MLCache. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? New test and existing tests. ### Was this patch authored or co-authored using generative AI tooling? No. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org