Hacker News with Generative AI: Memory Management

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.
Java 24 to Reduce Object Header Size and Save Memory (infoq.com)
JEP 450 (Compact Object Headers) has been targeted for delivery in JDK 24, and has already been merged to main.
Speculations on arenas and custom strings in C++ (nullprogram.com)
My techniques with arena allocation and strings are oriented around C. I’m always looking for a better way, and lately I’ve been experimenting with building them using C++ features. What are the trade-offs? Are the benefits worth the costs? In this article I lay out my goals, review implementation possibilities, and discuss my findings. Following along will require familiarity with those previous two articles.
Memory64 (github.com/WebAssembly)
This page describes a proposal to support linear memory of sizes larger than 232 bits. It provides no new instructions, but instead extends the currently existing instructions to allow 64-bit indexes.
Bounded Flexible Arrays in C (kernel.org)
Large projects written in C, especially those written close to the hardware layer like Linux, have long treated the language as a high-level assembler.
Tip of the day #2: A safer arena allocator (gaultier.github.io)
The most transformative action you can do to dramatically improve your code in a programming language where you are in control of the memory is: to use arenas.
Unleashing Power: Enabling Super Pages on the RPi (mairacanal.github.io)
Unleashing the power of 3D graphics in the Raspberry Pi is a key commitment for Igalia through its collaboration with Raspberry Pi. The introduction of Super Pages for the Raspberry Pi 4 and 5 marks another step in this journey, offering some performance enhancements and more efficient memory usage. In this post, we’ll dive deep into the technical details of Super Pages, discuss the challenges we faced during implementation, and illustrate the benefits this feature brings to the Raspberry Pi ecosystem.
Using less memory to look up IP addresses in Mess With DNS (jvns.ca)
I’ve been having problems for the last 3 years or so where Mess With DNS periodically runs out of memory and gets OOM killed.
Are you sure you want to use MMAP in your database management system? (2022) (cs.cmu.edu)
Memory-mapped (MMAP) file I/O is an OS-provided feature that maps the contents of a file on secondary storage into a program’s address space.
A deep dive into Linux's new mseal syscall (trailofbits.com)
If you love exploit mitigations, you may have heard of a new system call named mseal landing into the Linux kernel’s 6.10 release, providing a protection called “memory sealing.” Beyond notes from the authors, very little information about this mitigation exists. In this blog post, we’ll explain what this syscall is, including how it’s different from prior memory protection schemes and how it works in the kernel to protect virtual memory.