matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Feature Request]: support setting the upper limit of off-heap memory

Open aylei opened this issue 1 year ago • 2 comments

Is there an existing issue for the same feature request?

  • [X] I have checked the existing issues.

Is your feature request related to a problem?

There is no limit in MO when allocating off-heap memory.

Describe the feature you'd like

Introduce an upper limit of off-heap memory, throttle allocation and/or reclaim memory when the upper limit reached.

The limit should be tunable at runtime without restarting MO process.

cc @xzxiong

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

No response

Additional information

No response

aylei avatar Jun 05 '24 03:06 aylei

不是所有堆外分配的场景,都可以做内存回收。内存缓存、可以spill的hashmap或者batch/vector,这些场景可以。I/O,网络传输这些不可以。

所以需要针对每个具体的场景,实现可以配置和控制的容量,没法对全局的分配量做限制。

reusee avatar Oct 23 '24 04:10 reusee

实现伸缩,需要在使用堆外分配器的模块实现,不是在分配器内部。内存缓存容量控制、spill的逻辑,都不是在分配器实现的,没有统一的方法去实现的。

reusee avatar Oct 23 '24 04:10 reusee

堆外内存不能控制上限,否则会出现死锁的问题。

reusee avatar Nov 01 '24 02:11 reusee

off-heap memory is claimed by different consumers, track the memory limit implementation in these modules instead. e.g. https://github.com/matrixorigin/matrixone/issues/19414

aylei avatar Nov 01 '24 02:11 aylei