diff --git a/source/RobotAPI/libraries/armem/server/segment/SpecializedCoreSegment.h b/source/RobotAPI/libraries/armem/server/segment/SpecializedCoreSegment.h index 5ddca3e7d1dc0820a29039dba17af1e956d9897c..e34a65795c142a4629591e3f285bc58f9a869353 100644 --- a/source/RobotAPI/libraries/armem/server/segment/SpecializedCoreSegment.h +++ b/source/RobotAPI/libraries/armem/server/segment/SpecializedCoreSegment.h @@ -27,7 +27,7 @@ namespace armarx::armem::server::segment MemoryToIceAdapter& iceMemory, const std::string& defaultCoreSegmentName = "", aron::type::ObjectPtr coreSegmentAronType = nullptr, - int defaultMaxHistorySize = -1, + int defaultMaxHistorySize = 10, const std::vector<PredictionEngine>& predictionEngines = {}); virtual ~SpecializedCoreSegment() override; diff --git a/source/RobotAPI/libraries/armem/server/segment/SpecializedProviderSegment.h b/source/RobotAPI/libraries/armem/server/segment/SpecializedProviderSegment.h index 3cb50c52f42ba2e2ca35a5024755729b9226336f..6cbac5cad70e5590e2ac190768d9aa38c86542a2 100644 --- a/source/RobotAPI/libraries/armem/server/segment/SpecializedProviderSegment.h +++ b/source/RobotAPI/libraries/armem/server/segment/SpecializedProviderSegment.h @@ -29,7 +29,7 @@ namespace armarx::armem::server::segment const std::string& defaultCoreSegmentName = "", aron::type::ObjectPtr providerSegmentAronType = nullptr, aron::type::ObjectPtr coreSegmentAronType = nullptr, - int defaultMaxHistorySize = -1, + int defaultMaxHistorySize = 10, const std::vector<PredictionEngine>& providerSegmentPredictionEngines = {}, const std::vector<PredictionEngine>& coreSegmentPredictionEngines = {}); diff --git a/source/RobotAPI/libraries/armem/server/wm/detail/MaxHistorySize.cpp b/source/RobotAPI/libraries/armem/server/wm/detail/MaxHistorySize.cpp index cccf47eef46ad8fd9f5d4990f000232b731dea19..a6f3448ccbfdeb74f99bf766b4d9bb31b865b7a5 100644 --- a/source/RobotAPI/libraries/armem/server/wm/detail/MaxHistorySize.cpp +++ b/source/RobotAPI/libraries/armem/server/wm/detail/MaxHistorySize.cpp @@ -5,11 +5,21 @@ namespace armarx::armem::server::wm::detail { - void MaxHistorySize::setMaxHistorySize(long maxSize) + void MaxHistorySize::setMaxHistorySize(long maxSize, const std::string& additionalInfo) { if (maxSize < 0){ - ARMARX_WARNING << "The maxHistorySize for this core segment is set to < 0. This means nothing will ever be forgotten in working memory. " - << "This may slow down the memory server."; + if(additionalInfo != ""){ + ARMARX_INFO << "The maxHistorySize for this memory entity is set to < 0. " + << "This means nothing will ever be forgotten in working memory. " + << "This may slow down the memory server." + << "It is better to set the maxHistorySize per Provider- or CoreSegment"; + } else { + + ARMARX_DEBUG << "The maxHistorySize for this memory entity is set to < 0. " + << "This means nothing will ever be forgotten in working memory. " + << "This may slow down the memory server." + << "The entity name is " << additionalInfo; + } } this->_maxHistorySize = maxSize; } diff --git a/source/RobotAPI/libraries/armem/server/wm/detail/MaxHistorySize.h b/source/RobotAPI/libraries/armem/server/wm/detail/MaxHistorySize.h index 64eb07a63d4d8087378856623ea47c2edcee3b2f..7d0bbd6691f7b0a57ffe231fe2bb4faf828fd488 100644 --- a/source/RobotAPI/libraries/armem/server/wm/detail/MaxHistorySize.h +++ b/source/RobotAPI/libraries/armem/server/wm/detail/MaxHistorySize.h @@ -12,7 +12,7 @@ namespace armarx::armem::server::wm::detail * @brief Set the maximum number of snapshots to be contained in an entity. * Affected entities are to be update right away. */ - void setMaxHistorySize(long maxSize); + void setMaxHistorySize(long maxSize, const std::string& additionalInfo = ""); long getMaxHistorySize() const; diff --git a/source/RobotAPI/libraries/armem/server/wm/memory_definitions.cpp b/source/RobotAPI/libraries/armem/server/wm/memory_definitions.cpp index 973e3ca5c21f1913f5abb84718789b4d4d27b2d2..b4dfb1cf6de2a847c5285208f8f157e9d57409ad 100644 --- a/source/RobotAPI/libraries/armem/server/wm/memory_definitions.cpp +++ b/source/RobotAPI/libraries/armem/server/wm/memory_definitions.cpp @@ -16,7 +16,8 @@ namespace armarx::armem::server::wm void Entity::setMaxHistorySize(long maxSize) { - MaxHistorySize::setMaxHistorySize(maxSize); + std::string containerID = (this->id()).str(); + MaxHistorySize::setMaxHistorySize(maxSize, containerID); truncate(); } diff --git a/source/RobotAPI/libraries/armem/server/wm/memory_definitions.h b/source/RobotAPI/libraries/armem/server/wm/memory_definitions.h index 35015353a2653ca957bb19fe29c7e8430790885d..1249dcf039eac37545cc3b93cdf978eaa61be57f 100644 --- a/source/RobotAPI/libraries/armem/server/wm/memory_definitions.h +++ b/source/RobotAPI/libraries/armem/server/wm/memory_definitions.h @@ -101,7 +101,15 @@ namespace armarx::armem::server::wm ProviderSegment& addProviderSegment(const std::string& name, Args... args) { ProviderSegmentT& added = CoreSegmentBase::addProviderSegment(name, args...); - added.setMaxHistorySize(this->getMaxHistorySize()); + int maxHistorySize = this->getMaxHistorySize(); + if(maxHistorySize < 0){ + ARMARX_INFO << "The maxHistorySize for this core segment is set to < 0. " + << "This means nothing will ever be forgotten in working memory. " + << "This may slow down the memory server. \n" + << "Core Segment Name: " + << (this->id()).str(); + } + added.setMaxHistorySize(maxHistorySize); return added; }