Skip to content

ITEP-84109 [Release 2025.2] Bugfix: Memory usage steadily increases over time#1005

Open
ltalarcz wants to merge 10 commits intorelease-2025.2from
mem_leak_release
Open

ITEP-84109 [Release 2025.2] Bugfix: Memory usage steadily increases over time#1005
ltalarcz wants to merge 10 commits intorelease-2025.2from
mem_leak_release

Conversation

@ltalarcz
Copy link
Contributor

📝 Description

This pull request addresses issue #845 by adding a configurable timeout for cleaning up suspended tracks in the tracking system, preventing unbounded memory usage. The suspended track timeout can now be set via an environment variable, and old suspended tracks are automatically removed after the specified duration. Key changes span both the Python and C++ components of the tracking code.

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests
  • 🚂 CI

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Ran automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

@ltalarcz ltalarcz marked this pull request as draft February 12, 2026 10:49
@ltalarcz ltalarcz changed the title ITEP-84109 Bugfix: Memory usage steadily increases over time ITEP-84109 [Release 2025.2] Bugfix: Memory usage steadily increases over time Feb 12, 2026
@ltalarcz ltalarcz marked this pull request as ready for review February 12, 2026 17:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses a memory leak issue (Issue #845) in the SceneScape tracking system by implementing a configurable timeout mechanism for cleaning up suspended tracks. The suspended tracks were accumulating indefinitely in memory, causing unbounded memory growth over time. The solution adds a new suspended_track_timeout_secs parameter (default: 60 seconds) that automatically removes suspended tracks after they exceed the specified age.

Changes:

  • Added configurable suspended_track_timeout_secs parameter with a default value of 60.0 seconds across the tracking system
  • Implemented cleanup logic in C++ TrackManager that removes old suspended tracks during each prediction cycle
  • Updated Python bindings and configuration flow to expose the new parameter throughout the stack

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
controller/src/robot_vision/include/rv/tracking/TrackManager.hpp Added mSuspendedTrackMaxAgeSecs config field and mSuspensionTimes map to track suspension timestamps; added cleanupOldSuspendedTracks method declaration
controller/src/robot_vision/src/rv/tracking/TrackManager.cpp Implemented cleanup logic to remove old suspended tracks; updated suspendTrack/reactivateTrack to maintain suspension times; calls cleanup at start of both predict() methods
controller/src/robot_vision/python/src/robot_vision/extensions/tracking.cpp Exposed suspended_track_timeout_secs parameter in Python bindings for TrackManagerConfig
controller/src/controller/tracking.py Added DEFAULT_SUSPENDED_TRACK_TIMEOUT_SECS constant (60.0 seconds)
controller/src/controller/ilabs_tracking.py Updated IntelLabsTracking constructor to accept and configure suspended_track_timeout_secs parameter
controller/src/controller/time_chunking.py Updated TimeChunkedIntelLabsTracking to propagate suspended_track_timeout_secs to child trackers
controller/src/controller/scene.py Added suspended_track_timeout_secs parameter to Scene initialization and tracker setup
controller/src/controller/scene_controller.py Updated extractTrackerConfigData to parse suspended_track_timeout_secs from config file with default fallback
controller/src/controller/cache_manager.py Updated refreshScenes to include suspended_track_timeout_secs in tracker_config array
controller/config/tracker-config.json Added suspended_track_timeout_secs: 60.0 to default tracker configuration
controller/config/tracker-config-time-chunking.json Added suspended_track_timeout_secs: 60.0 to time-chunking tracker configuration
tests/system/metric/test_data/tracker-config.json Added suspended_track_timeout_secs: 60.0 to test configuration
tests/system/metric/test_data/tracker-config-time-chunking.json Added suspended_track_timeout_secs: 60.0 to time-chunking test configuration
tests/system/metric/tc_tracker_metric.py Updated test to parse and pass suspended_track_timeout_secs parameter
controller/docs/user-guide/How-to-configure-tracker.md Added documentation section explaining the new Suspended Track Timeout parameter

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@saratpoluri saratpoluri enabled auto-merge (squash) February 18, 2026 05:01
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

Successfully merging this pull request may close these issues.

3 participants