ZhenshengLee / ros2_shm_msgs

ROS2 shm_msg based zero-copy for image and pointcloud.
128 stars 22 forks source link

The DATA_MAX_SIZE parameter is set too large, causing memory allocation errors #28

Open tiantian500 opened 1 year ago

tiantian500 commented 1 year ago

Hi,

thanks for the awesome examples.

i tried to create a PointCloud240m.msg,and change uint32 DATA_MAX_SIZE=251658240. when i run ./pcl240m_talker error i have got: '''

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)

''' it seems DATA_MAX_SIZE is set too large

Any idea how to publish the pcd file with 240M ?

ZhenshengLee commented 1 year ago
  1. please post your code as a branch of your fork.
  2. please use the gdb to debug your code to get call stack.
  3. may related to https://stackoverflow.com/questions/30171528/how-to-dynamically-allocate-big-memory-like-10-g-using-new-operator-in-c-on

thanks for your report! please star it if you like.