COSMIC Alpha 4 Released For System76's Rust-Based Desktop

2 years ago by Karna to c/linux

load all comments
OsrsNeedsF2P 2 points 2 years ago

memory leak fixes,

But muh Rust??

path: 0 13812229, hotness: undefined, score: 2, children: 7
naonintendois 37 points 2 years ago

Rust doesn't prevent memory leaks. You can do that in every language

path: 0 13812229 13812361, hotness: undefined, score: 37, children: 6
OsrsNeedsF2P 25 points 2 years ago

Back when I was a wee bit Java noob, I was trying to write a RuneScape bot to play Soul Wars. I had a basic recursive pathfinding algo for figuring out how to walk around the map, but it blew out of memory very quickly (each tile has 4 options, do that recursively, etc). So I added caching. Anyways, I never cleared the caching. So after 20 minutes of running the script, you had like 2GB of allocated RAM calculating the best path from any 2 tiles in the minigame.

Great times. No amount of language safety features would have saved me from that stupidity.

path: 0 13812229 13812361 13813216, hotness: undefined, score: 25, children: 1
ryannathans 2 points 2 years ago

Oops, banned for botting

path: 0 13812229 13812361 13813216 13816262, hotness: undefined, score: 2, children: 0
flashgnash 4 points 2 years ago

Thought the whole point was that it forced you to handle memory properly and automatically released things when they go out of scope

What kind of situation can cause a memory leak in rust

path: 0 13812229 13812361 13842020, hotness: undefined, score: 4, children: 3
naonintendois 4 points 2 years ago

You can have a memory leak when items are still in scope in some loop or when you have a reference count cycle. The latter happens with the Rc/Arc types in rust.

An example for the former can be a web server that keeps track of every request it's ever received in memory. You will eventually run out of memory. But you did not violate any memory rules (dangling pointer, etc.). Memory leaks can be caused by design issues.

path: 0 13812229 13812361 13842020 13844686, hotness: undefined, score: 4, children: 2
linux
linux

@lemmy.ml

login for more options
65961
9047
4822

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

go to feed...