Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak after reopening connection #169

Open
seribuan opened this issue Dec 4, 2024 · 2 comments
Open

Memory leak after reopening connection #169

seribuan opened this issue Dec 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@seribuan
Copy link

seribuan commented Dec 4, 2024

After closing and reopening the connection to devices again. There seems to be a memory leak. The memory used become doubled.

@olofhagsand olofhagsand added the bug Something isn't working label Dec 5, 2024
@olofhagsand
Copy link
Member

Confirmed. The old connection (and the memory associated with it) is kept and not released.
This can be seen by the show mem command after two reconnects:

olof@alarik> show memory backend 
...
YANG
top/config                301K         
top/data                  460K         
default/openconfig2       11M         
default/openconfig2       11M         <--- 
default/openconfig2       11M         <---
YANG Total                33M         
Mem Total                 33M    

@olofhagsand
Copy link
Member

This is actually quite complicated.
The problem is that on reconnect, the mount-point is removed from the old yang, in order to handle upgrades.
That is, if a device is upgraded with new YANG, the new YANG should be installed and bound for the device.
However, the old yang may be used by other devices and also in an intermediate phase during a commit diff evaluation, the old yang is bound to running while the new yang is bound to candidate.
During the time when the old yang is still used it cannot be removed.
It can be removed when no references from any datastore XML cache uses it.
But this is non-trivial.
Maybe it could be solved by clearing caches.
The workaround is to restart the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants