-
Notifications
You must be signed in to change notification settings - Fork 50
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
missing Close() method for VirtualNetwork #161
Comments
Created a small GitHub repo with a reproduction: https://github.com/urish/virtualnetwork-leak It's basically the same code as above, but packaged into a go project for easier reproduction. |
Thanks. Sorry for not noticing this earlier, but I will take a look at this. |
Thanks! |
The code as in the example for i := 0; i < 1000; i++ {
_, err := virtualnetwork.New(&config)
if err != nil {
panic(err)
}
}
runtime.GC() just claims a new device and never release, hence an out-of-memory. |
From my point of view, having a |
OK, just to confirm that the issue is about adding additional functionality
to deconstruct. :+1
…On Fri, Dec 2, 2022 at 2:23 PM Uri Shaked ***@***.***> wrote:
From my point of view, having a Close() method which would release a
VirtualNetwork would be ideal
—
Reply to this email directly, view it on GitHub
<#161 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAOZRUSWCPD3CPBC7JMZDWLGIUTANCNFSM6AAAAAASHPZ3JI>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
--
Gerard Braad | http://gbraad.nl
STEM is the source, but BUILD is how you develop!
[ Better Understanding Involves Learning and Doing ]
|
Yes 😀 |
Spent some time on this, and most of the memory consumption is coming from |
will also have to spend more time on this. I see memory leaks on Windows, but they are caused by something else that fails first |
Currently, there's no way to free the memory allocated by VirtualNetwork.
For instance, the following code will leak around ~100MB of memory:
Output:
The implementation of memStats() (taken from here):
The text was updated successfully, but these errors were encountered: