Hacker News with Generative AI: Memory Management

TIL: Rust does not prevent memory leaks (ycombinator.com)
I'm not a Rust developer so I have no clues about what Rust does, how it does or why it is the way it is.<p>I had a short interaction on another thread and some user told that Rust does not prevent memory leaks.<p>People talk so much about Rust memory safety and how everything must be rewritten in Rust, but if Rust does not prevent memory leaks why are people so crazy about it?
Rust Memory Management Explained (infoworld.com)
Rust's ownership and borrowing mechanisms guarantee memory safety at runtime. Here's how to use them in your programs.
JEP draft: 4-byte Object Headers (Experimental (openjdk.org)
Reduce the size of object headers in the HotSpot JVM from between 64 and 128 bits down to 32 bits on 64-bit architectures. This will reduce heap size, improve deployment density, and increase data locality.
The inevitability of the borrow checker (yorickpeterse.com)
When defining a type in Inko, it's allocated on the heap by default.
The Inevitability of the Borrow Checker (yorickpeterse.com)
When defining a type in Inko, it's allocated on the heap by default.
Go Data Structures (2009) (swtch.com)
When explaining Go to new programmers, I've found that it often helps to explain what Go values look like in memory, to build the right intuition about which operations are expensive and which are not. This post is about basic types, structs, arrays, and slices.
Show HN: CLR, POC borrow checker for Zig (github.com/ityonemo)
Zig is a famously "unsafe" language. Memory management is done manually, which opens up the possibility of having implementation errors in the code. While many security issues are due to logical implementation errors, memory safety errors are a large and real surface area for released software.
Practical use of the null garbage collector (2018) (microsoft.com)
Some time ago, I noted that the null garbage collector is a valid garbage collector if the amount of RAM available to the runtime is greater than the total memory requirements of the program.
Rust: Investigating an Out of Memory Error (qovery.com)
TL;DR: We discovered the hard way that when backtrace is enabled, the anyhow library is capturing a backtrace on every error. Only when printing this error in debug format!(”err: {:?}”, error) backtrace’s symbols are resolved to human-friendly names, thus leading to a significant memory increase for your application. If you need backtrace only on panic, you must set two environment variables, RUST_BACKTRACE=1, and RUST_LIB_BACKTRACE=0, to avoid the issue.
YJIT 3.4: Even Faster and More Memory-Efficient (railsatscale.com)
It’s 2025, and this year again, the YJIT team brings you a new version of YJIT that is even faster, more stable, and more memory-efficient.
Understanding Memory Management, Part 1: C (educatedguesswork.org)
I've been writing a lot of Rust recently, and as anyone who has learned Rust can tell you, a huge part of the process of learning Rust is learning to work within its restrictive memory model, which forbids many operations that would be perfectly legal in either a systems programming language like C/C++ or a more dynamic language like Python or JavaScript. That got me thinking about what was really happening and what invariants Rust was trying to enforce.
Writing a simple pool allocator in C (8dcc.github.io)
I found out about pool allocators some time ago, and I really liked its simplicity and high performance, so I decided to write my own. This article was initially inspired by Dmitry Soshnikov’s article.
Linux Context Switching Internals: Process State and Memory (codingconfessions.com)
How does the Linux kernel represent processes and their state: A breakdown of task_struct and mm_struct
Visualizing memory layout of Rust's data types (youtube.com)
Debugging memory corruption: who the hell writes "2" into my stack? (2016) (unity.com)
MiB working set on a 64 GiB machine (2023) (wordpress.com)
Memory is a relatively scarce resource on many consumer computers, so a feature to limit how much memory a process uses seems like a good idea, and Microsoft did indeed implement such a feature. However:
Using Drop for safety in Rust (chriskrycho.com)
A deep dive into Rust’s vec::Drain and its Drop implementation as an example of how ownership prevents subtle bugs—memory and otherwise!
Garbage collected smart pointers in Rust via concurrent cycle collection (maplant.com)
Ten years ago I wrote an article on how to implement a conservative garbage collector for C, and I got a lot of constructive criticism regarding the actual usefulness of the code presented. It only makes sense that on the ten-year anniversary of publishing I should try to fix my error by writing a garbage collector that is precise, does not make assumptions, and (hopefully) actually works.
Zig Software Foundation – Introducing Carmen the Allocgator (ziglang.org)
Over here at the Zig Software Foundation, we're following the latest trends. We know what's important to you all - watching the line go up.
Programming Language Memory Models (2021) (swtch.com)
Programming language memory models answer the question of what behaviors parallel programs can rely on to share memory between their threads.
In C, memory management begins – The Craft of Coding (wordpress.com)
When you learn to program in C, more often than not people side-step the issue of memory management. It’s the one language where you really have to get a handle on the concepts of memory from day one.
Weak pointers in Go: why they matter now (victoriametrics.com)
Weak Pointers in Go: Why They Matter Now
How Much Memory Do You Need in 2024 to Run 1M Concurrent Tasks? (hez2010.github.io)
As we have observed, a high number of concurrent tasks can consume a significant amount of memory, even if they do not perform complex operations. Different language runtimes have varying trade-offs, with some being lightweight and efficient for a small number of tasks but scaling poorly with hundreds of thousands of tasks.
Float Self-Tagging (arxiv.org)
Dynamic and polymorphic languages must attach information, such as types, to run time objects, and therefore adapt the memory layout of values to include space for this information.
Float Self-Tagging (arxiv.org)
Dynamic and polymorphic languages must attach information, such as types, to run time objects, and therefore adapt the memory layout of values to include space for this information.
Show HN: memsparkline – Track RAM usage of process and descendants in real time (github.com/dbohdan)
Solving Large Problems with a Small Working Memory (2013) [pdf] (core.ac.uk)
Revisiting the DOS Memory Models (blogsystem5.substack.com)
At the beginning of the year, I wrote a bunch of articles on the various tricks DOS played to overcome the tight memory limits of x86’s real mode. There was one question that came up and remained unanswered: what were the various “models” that the compilers of the day offered?
Ultra-low-latency, batching and concurrent queue for IPC in Java (github.com/coralblocks)
CoralRing is an ultra-low-latency, lock-free, garbage-free, batching and concurrent circular queue (ring) in off-heap shared memory for inter-process communication (IPC) in Java across different JVMs using memory-mapped files.
What Is Your RAM Usage on macOS? Share Your Workflow and Use Case (ycombinator.com)
I'm trying to understand the memory requirements for different workflows on macOS.