DEV Community

Discussion on: How does your language handle memory?

Collapse
mortoray profile image
edA‑qa mort‑ora‑y

Automatic and manual are tricky to separate, and they aren't really language specific.

Stick with standard types and smart pointers and C++ has fully automated memory management.

C# frequently uses a Dispose system which is manual management.

Rust uses "move" semantics by default, and generally has automatic management. It of course offers manual management for places where it's necessary.

There are also other ways to manage memory, and the consideration of stack/heap/caches/etc. ensures it's a nice rich topic for endless discussion. :)

Collapse
orkon profile image
Alex Rudenko • Edited on

That's right :-) Basically, I agree that the Rust is probably automated... I separate it like this: manual if you write something in your program to free memory properly (smart pointers/free etc.) and automated if it is built-in into the runtime/language so that you don't to specifically care about it (unless your memory starts leaking, yeah).