From d53d3395626404cdb6c9501570def358fd90fd95 Mon Sep 17 00:00:00 2001 From: Michael Grupp Date: Tue, 29 May 2018 11:04:29 +0200 Subject: [PATCH] Sanitize node memory consumption with a smaller TF buffer size. (#879) Fixes an (almost) unbounded growth of the TF buffer. See the heap profile logs in the PR for more information. --- .../cartographer_ros/cartographer_grpc/node_grpc_main.cc | 2 +- cartographer_ros/cartographer_ros/node_main.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cartographer_ros/cartographer_ros/cartographer_grpc/node_grpc_main.cc b/cartographer_ros/cartographer_ros/cartographer_grpc/node_grpc_main.cc index 36ba3f5..0e33f99 100644 --- a/cartographer_ros/cartographer_ros/cartographer_grpc/node_grpc_main.cc +++ b/cartographer_ros/cartographer_ros/cartographer_grpc/node_grpc_main.cc @@ -45,7 +45,7 @@ namespace cartographer_ros { namespace { void Run() { - constexpr double kTfBufferCacheTimeInSeconds = 1e6; + constexpr double kTfBufferCacheTimeInSeconds = 10.; tf2_ros::Buffer tf_buffer{::ros::Duration(kTfBufferCacheTimeInSeconds)}; tf2_ros::TransformListener tf(tf_buffer); NodeOptions node_options; diff --git a/cartographer_ros/cartographer_ros/node_main.cc b/cartographer_ros/cartographer_ros/node_main.cc index b41972c..62d8181 100644 --- a/cartographer_ros/cartographer_ros/node_main.cc +++ b/cartographer_ros/cartographer_ros/node_main.cc @@ -44,7 +44,7 @@ namespace cartographer_ros { namespace { void Run() { - constexpr double kTfBufferCacheTimeInSeconds = 1e6; + constexpr double kTfBufferCacheTimeInSeconds = 10.; tf2_ros::Buffer tf_buffer{::ros::Duration(kTfBufferCacheTimeInSeconds)}; tf2_ros::TransformListener tf(tf_buffer); NodeOptions node_options;