Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared Memory Support for Large Messages #349

Closed
cesurs opened this issue Dec 19, 2024 · 2 comments
Closed

Shared Memory Support for Large Messages #349

cesurs opened this issue Dec 19, 2024 · 2 comments

Comments

@cesurs
Copy link

cesurs commented Dec 19, 2024

Hello, I realized that when i use shared memory with less than ~4.2 MB of data Zenoh can use shared memory but when I start publishing large messages I get the error:

  WARN ThreadId(06) zenoh_shm: SharedMemoryManager does not have sufficient free memory to allocate 5000010 bytes, try de-fragmenting! at /root/.cargo/git/checkouts/zenoh-cc237f2570fab813/e66745e/commons/zenoh-shm/src/lib.rs:409.
terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
  what():  failed to publish message: Failed to allocate a SHM buffer, even after GCing, at /root/ws_rmw_zenoh/src/rmw_zenoh/rmw_zenoh_cpp/src/rmw_zenoh.cpp:917, at ./src/rcl/publisher.c:284

I tried to use zc_shm_defrag (By the way I cannot find any sort of documentation or reference for zc_shm_gc or zc_shm_defrag functions) function but it did not help. Is this expected behaviour and how can I solve this issue. When I use default fastrtps middleware it can share the messages through shared memory with no problems.

@Yadunund
Copy link
Member

Hi there,

rmw_zenoh does not support SHM just yet but it should be coming soon now that we've migrated to Zenoh-1.0.

I'll close this issue as it is a duplicate of #220 and relates to #175

@cesurs
Copy link
Author

cesurs commented Dec 20, 2024

Thanks, changing

#define SHM_BUFFER_SIZE_MB 10

value (which I for some reason set to 4 previously) at rmw_zenoh/rmw_zenoh_cpp/src/rmw_init.cpp made it possible to share larger messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants