this post was submitted on 04 Jul 2023
2236 points (99.0% liked)
Lemmy.World Announcements
29028 readers
3 users here now
This Community is intended for posts about the Lemmy.world server by the admins.
Follow us for server news ๐
Outages ๐ฅ
https://status.lemmy.world
For support with issues at Lemmy.world, go to the Lemmy.world Support community.
Support e-mail
Any support requests are best sent to [email protected] e-mail.
Report contact
- DM https://lemmy.world/u/lwreport
- Email [email protected] (PGP Supported)
Donations ๐
If you would like to make a donation to support the cost of running this platform, please do so at the following donation URLs.
If you can, please use / switch to Ko-Fi, it has the lowest fees for us
Join the team
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
That's not a memory leak though. That's just hording memory. Leaked memory is inaccessible.
In the example itโs inaccessible.
It's not. The vec is still accessible and if it goes out of scope rust automatically clears the memory.
But it will never fall out of scope because of the loop
Exactly but it's still accessible since it's in scope.
Right but where does it say that something has to be inaccessible to qualify as a memory leak?
"A memory leak is a process in which a program or application persistently retains a computerโs primary memory. It occurs when the resident memory program does not return or release allocated memory space, even after execution, resulting in slower or unresponsive system behavior." Source
Thatโs not a serious source. Any unbound allocation is a memory leak if it serves no useful purpose.
Exactly.