RS SDK - Memory Leakage via CommandBarPopup
Shaun
✭
Hi there,
I just thought I'd pass on an observation that I've made about a possible memory leakage associated with a CommandBarButtonGroup event handler.
I have found that after synchronising a group of paths to the VC using...
result = task.SyncPathProcedure(path.ModuleName + "/" + path.Name, SyncDirection.ToController, messages);
... I then find that the memory usage for RobotStudio.exe started running away, increasing until it tops out at over 2GB.
After trying to locate the cause of this leak, I eventually tracked it down to the DisplayCommandGroupEventHandlers that I am using for showing a dynamically updated CommandBarButtonGroup underneath a series of CommandBarPopup menus. In the DisplayCommandGroupEventHandler, if I call...
e.AddItem(string caption, object tag, Image image, bool isChecked, bool isEnabled);
...to update the items that should appear in the button group, then this memory leakage problem occurs, although only after using the SyncPathProcedure() call. As far as I can tell there is no link between the parameters I am passing to e.AddItem() and the synchronisation procedure.
To solve this leakage problem, I have had to set the CommandBarPopup "Enabled" state to...
popup.Enabled = CommandBarPopupEnableMode.Enabled;
... which only updates the state of the popup when the button is pressed, rather than the default enabled state of "CommandBarPopupEnableMode.Dynamic", which appears to update the CommandBarButtonGroup whenever it can. However, it's interesting that this memory leakage only appears to happen after I synchronise paths, so if someone could explain why this is the case I would be very interested.
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings