-
Notifications
You must be signed in to change notification settings - Fork 30
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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 leaks with resumes? #750
Comments
Thanks for the issue! We often have issues with memory leaks, so I wouldn't be surprised. The images aren't loading, so I'm not entirely sure what you're referring to (I couldn't observe abnormal memory usage for Problem1 in LLVM, for example). What backend are you using and how are you measuring the memory leaks? |
Exchanged the images with new versions hope they work now. I use the JavaScript backend on Windows 10 and use the Task Manager to track the memory (as the images would show) |
In general, we are not the most memory efficient language. However, in your example, you are creating So, assuming something like 500 bytes per array, this is roughly 1000 Petabytes. JS is garbage collected, so in general we cannot guarantee that the memory will be freed right-away. However, given that the program terminates on your computer says a lot about it not leaking too much memory ;) It is also not very surprising that the list version allocates a lot more, since there we allocate roughly 50 linked objects. The following will not make a lot of sense to you, but what we could investigate is whether the "shadow stack" of regions potentially holds onto the arrays for too long preventing GC to do its work. Again, given that the program terminates at all I'd say we are good here. (disclaimer: I only thought a few minutes about this, so I might be wrong with my analysis) |
I have to say, I like this as a benchmark though ;) Here (for N=24) is JS (
and llvm:
Here LLVM uses 5,6 GB peak memory, while JS is around 58 MB! (cc @phischu). Nevertheless, it is still twice as fast. |
Thank you for minifying these examples. The expected result if you would print
In a handler like this, the increments will only be done after the very last |
Wouldn't the following code then have the same issue if that is the problem? I reduced the iterations to
I removed the first
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
The following code works fine. But by changing small things I seem to get memory leaks and I dont know why. I would like to know if this is a me issue or Effekt issue does anyone know about this? I provide example memory usage after about 20s of running each code.
Working:
Problem1:
If I either change it to this (add a counter to the effect):
Problem2:
Or to this (exchange array with list):
The text was updated successfully, but these errors were encountered: