Files
allwpilib/ntcore
Guinea Wheek 50fd29e697 [ntcore] Fix unbounded memory size tracker (#8929)
If a `ClientMessageQueue` is at a
memory limit, `ClientMessageQueueImpl::ClientSetValue` will still
increment `m_valueSize.size` even though no element has actually been
actually been added.

This quickly results in things like topics completely shutting down
under high load, as no new elements can be added as `m_valueSize.size`
explodes to infinity unless `ClearQueue()` is explicitly called. You can
see this pretty easily with the following code, be it in sim or on a
robot:

```cpp
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
class Robot : public wpi::TimedRobot {
  public:
  // ...
  uint64_t value{0};
  /**
   * This function is called periodically during all modes
   */
  void RobotPeriodic() override {
    for (int i = 0; i < 1'000'000; i++) {
      value += 1;
      wpi::SmartDashboard::PutNumber("value", value);
    }
  }
}
```

Connecting via your favorite dashboard quickly reveals that no new
values get added after a while. However, with this patch implemented,
values do still continue to increment as updates gradually get serviced.
2026-05-29 11:01:13 -07:00
..
2026-03-13 23:05:55 -07:00
2025-11-07 23:09:21 -08:00

ntcore

ntcore is a library for using NetworkTables. To learn more about what NetworkTables is, read https://docs.wpilib.org/en/latest/docs/software/networktables/networktables-intro.html.

If you're a developer looking for the NetworkTables protocol specifications, take a look at the doc folder.