Closed janetat closed 1 month ago
There is a PR to allow defining shared memory size at runtime, but it's not finished yet https://github.com/eunomia-bpf/bpftime/pull/285
https://github.com/eunomia-bpf/bpftime/pull/285 这是通过命令行的方式传递共享内存大小,也是静态、固定的。
期望是达到Max之后,还能自动地增加共享内存么?
285 这是通过命令行的方式传递共享内存大小,也是静态、固定的。
期望是达到Max之后,还能自动地增加共享内存么?
It's not supported now. But since boost::interprocess provided such ability, we may add it later
//!Tries to resize the managed shared memory object so that we have
//!room for more objects.
//!
//!This function is not synchronized so no other thread or process should
//!be reading or writing the file
static bool grow(const char *shmname, size_type extra_bytes)
{
return base_t::template grow
<basic_managed_shared_memory>(shmname, extra_bytes);
}
Now you can use flag like BPFTIME_SHM_MEMORY_MB
to control the size of the shared memory. For example,
SPDLOG_LEVEL=Debug BPFTIME_SHM_MEMORY_MB=50 LD_PRELOAD=/home/yunwei37/bpftime/build/runtime/syscall-server/libbpftime-syscall-server.so ./example/malloc/malloc
It can set the shared memory size to 50MB. We may use grow
in the future.
问题
期望
共享内存可以动态增长吗?