GEN_3 Positional Tracking: Memory Growth Issue

Thanks to the Stereolabs team for the great SDK, and for always being responsive to these reports — really appreciate the support.

I want to use POSITIONAL_TRACKING_MODE::GEN_3 for VIO only (DEPTH_MODE::NONE,
enable_area_memory=false, no spatial mapping). After running it for a few
minutes the pose output frequency keeps dropping. I investigated and found
that process memory (RSS) keeps climbing at the same time.

Setup

  • ZED2i, SDK 5.5.0
  • Jetson AGX Orin 32GB, JetPack 6.2.1 (L4T R36.4.4)
  • InitParameters: depth_mode=NONE
  • PositionalTrackingParameters: mode=GEN_3, enable_area_memory=false,
    enable_imu_fusion=true (default)
  • Loop: grab() + get_position() only, nothing else retrieved

Result (3 min, static camera, low-texture scene)

  • RSS: 143.6 MB → 253.0 MB, and the growth rate itself accelerates
    (0.48 MB/s in the first half → 0.82 MB/s in the second half)
  • Hz: 57.5 → 55.2, still declining (Although this isn’t a precise measurement, I have previously observed instances where the 120 Hz dropped to 30 Hz..)
  • get_positional_tracking_keyframes()/get_positional_tracking_landmarks()
    show the internal map growing the whole time: keyframes 4→274, landmarks
    55→365

Ruled out

  • Negative control (tracking disabled, grab() only): RSS stays flat
  • enable_imu_fusion=false: no improvement

Only mitigation I found: periodically calling reset_positional_tracking()
cuts the steady-state growth rate by ~90% (0.6–0.8 MB/s → ~0.05 MB/s) and
stops the Hz decline, at the cost of a brief (~2-4s) re-acquisition dip each
time. That’s a workaround, not a fix — and ideally I’d like to avoid it
entirely, since reset_positional_tracking() also resets the VIO coordinate
frame back to the origin each time (I passed an identity Transform in my
test). Is there a way to clear the internal map/keyframes without
discarding the current pose reference frame, or does passing the last known
pose as the Transform argument avoid that jump?

Questions:

  1. Is it expected/by-design for keyframes and landmarks to keep accumulating
    even with enable_area_memory=false, or should the internal map stay
    empty/bounded in this mode?
  2. Is there any way to get GEN_3 VIO (no area memory) with flat memory,
    without periodic resets?

Hi @ShinKengoAgbee,

Thank you for the detailed report and for the kind words; the measurements you collected are very helpful.

There is currently no API to clear only the internal map. Passing the last known pose (retrieved with get_position in REFERENCE_FRAME::WORLD) as the Transform argument of reset_positional_tracking re-initializes the tracking at that pose, so the coordinate frame does not jump back to the origin. The short re-acquisition phase remains.

GEN_3 keeps a local keyframe map for VIO even when enable_area_memory is disabled, but this map is supposed to stay bounded. A continuous growth with a static camera, together with the RSS increase and the pose rate decline, is not the expected behavior.

Not with ZED SDK v5.5.0; I forwarded your report to the SLAM team so they can reproduce and fix the issue. To speed up the investigation, could you please share an SVO recording of the low-texture scene where you observe the growth, together with your minimal test code? You can send them privately to support@stereolabs.com if you prefer.

You can find more information about the GEN_3 behavior in the Positional Tracking Modes documentation, and the fix will be announced in the ZED SDK release notes.

An update to my reply with a feedback received by the SDK Team:

With enable_area_memory=false, the GEN_3 mode keeps a bounded map. The growth you see comes from two things:

  1. The map is bounded by keyframe count (currently 500), not by time. GEN_3 keeps adding keyframes even when the robot is static (at least one per second, more in low-texture scenes like theirs), so the limit is reached after about 5 to 8 minutes. Your test stopped at 3 minutes, with 274 keyframes, before reaching it.
  2. Landmarks are not freed when your keyframes are removed. They are kept until about 15 minutes after that keyframe was created, so they can still be matched by the current tracking. A landmark still in view at that point is kept for another 15 minutes.

So memory should stop growing after about 15 minutes of operation and then stay flat.