Skip to content

Archive

Memory

37 articles
Tech 14 Sep 2026 5 min read

Memory Compression Keeps More Active Data in RAM

Modern operating systems can hold compressed copies of memory pages in RAM when physical memory becomes crowded. The technique increases the amount of useful data that fits in a fixed quantity of RAM without changing the installed hardware. Compression is not free capacity. It exchanges processor time and some memory space for a smaller representation of data that would otherwise occupy more RAM or become a candidate for storage-backed paging.

Artificial Intelligence 13 Sep 2026 6 min read

Trade Activation Memory for Recomputation with Gradient Checkpointing

Training a deep neural network requires more memory than its parameters alone suggest. Backpropagation needs intermediate values from the forward pass, and retaining those activations across many layers can consume a large share of accelerator memory. Gradient checkpointing changes that storage policy. Instead of retaining every intermediate activation until its gradient is computed, training keeps selected boundary tensors and reconstructs omitted intermediates by running parts of the forward computation again during the backward pass. The model function need not change, but the execution schedule does.

Tech 13 Sep 2026 6 min read

Sleep and Hibernation Handle Memory Differently

Closing a laptop lid can make the screen go dark almost at once, yet the next lid opening may restore every window in seconds. A computer can produce a similar result after hibernation, even though the underlying state is quite different. Both modes preserve an open session, but they do not preserve it in the same place or with the same dependence on electrical power. The distinction matters most when a computer stays unused for a long period, its battery becomes depleted, or resume time matters. It also explains how a machine can appear to continue from the same desktop after spending hours with little or no active power draw.

Go 13 Sep 2026 5 min read

Reserve Slice Capacity with slices.Grow in Go

A slice can have enough logical elements for the current operation and still lack room for the next append. When the number of upcoming elements is already known, slices.Grow makes that capacity requirement explicit without changing the slice length. The function joined the standard library with the slices package in Go 1.21. Its contract is narrow: given a slice and a non-negative count, it returns a slice with enough capacity to append at least that many additional elements without another allocation.

Go 13 Sep 2026 4 min read

Replace Slice Ranges with slices.Replace in Go

slices.Replace changes a contiguous range of a slice and can make the resulting slice shorter, longer, or the same length. That makes it more than element assignment: the operation combines range removal and insertion while retaining Go slice storage semantics. Its signature accepts any slice element type: func Replace[S ~[]E, E any](s S, i, j int, v ...E) S The half-open range s[i:j] is replaced by the values in v. Since the resulting length can change, the returned slice value is part of the operation’s contract.

Go 13 Sep 2026 4 min read

Remove Slice Ranges with slices.Delete in Go

slices.Delete removes one contiguous range from a slice and shifts the remaining suffix toward the front. The operation modifies the supplied backing storage, so its returned slice header is part of the result rather than an optional convenience. Its signature accepts any slice element type: func Delete[S ~[]E, E any](s S, i, j int) S The half-open interval s[i:j] follows ordinary Go slicing rules. Elements at indices from i through j-1 are removed, while elements before i retain their positions.

Go 13 Sep 2026 4 min read

Limit Slice Capacity with slices.Clip in Go

A Go slice can expose more capacity than its current length. slices.Clip removes that spare capacity from the slice header, setting capacity to length without copying the elements into new storage. The operation is deliberately narrow. It changes the range that a later append can reuse through that slice value, but it does not release the backing array or create an independent copy. Clip is a full slice expression The standard library defines Clip with this signature:

Go 13 Sep 2026 4 min read

Copy Slice Storage with slices.Clone in Go

A slice assignment copies a slice header, not its elements. After b := a, both slice values can still refer to the same backing array, so an element update through one value can appear through the other. slices.Clone provides a compact standard-library operation for the cases that need a copy of the slice elements instead. The function is part of the slices package. Its result has the same length as the input and contains the same elements, but later replacement of an element in one slice does not replace the corresponding element in the other.

Tech 12 Sep 2026 5 min read

Virtual Memory and Storage Under Memory Pressure

A computer can keep several large applications open even when their combined memory demands exceed the amount of physical RAM available at that moment. The operating system manages this pressure by deciding which memory contents need to remain in RAM and which can be moved elsewhere or discarded and recreated later. Virtual memory is central to that process. It gives software an address space that is separate from the exact layout of physical RAM, allowing the operating system to map memory pages to different physical locations as conditions change.

Go 10 Sep 2026 5 min read

Restrict Slice Capacity in Go with slices.Clip

A Go slice can be much smaller than the backing array it refers to. That spare capacity is useful when more append calls are coming, but sometimes you deliberately want the opposite: a result whose capacity stops exactly at its current length. slices.Clip expresses that operation directly. It reduces a slice’s capacity to its length without changing its elements or length. The detail that matters is what this does, and doesn’t, imply about memory.

Tech 06 Sep 2026 7 min read

Why Background Browser Tabs Sometimes Reload

You leave a web page open in a background tab, work elsewhere for a while, and then return to it. Instead of appearing exactly as you left it, the page briefly goes blank, shows a loading indicator, or fetches its contents again. This can look like a browser failure, but it is often deliberate resource management. An open tab is not necessarily a promise that the entire page will remain active in memory indefinitely. Browsers and operating systems can reduce the resources used by pages you are not currently viewing, especially when memory is needed elsewhere.

Linux 05 Sep 2026 9 min read

Create Sealable In-Memory Files on Linux with memfd_create

Applications often need a temporary chunk of data that behaves like a file without needing a persistent pathname. A process may build a configuration snapshot, compiled artifact, or serialized message, then map it into memory or pass it to another process. A regular temporary file can do that, but it introduces filesystem naming, cleanup, permissions, and lifetime concerns. An anonymous mmap() avoids the pathname, but it does not produce an ordinary file descriptor that can be passed to APIs expecting file-backed data.

Tech 02 Sep 2026 8 min read

What RAM Does and How Much Memory You Actually Need

Random-access memory, usually shortened to RAM, is one of the specifications people see when buying a computer, tablet, or phone. A device might have 8 GB, 16 GB, 32 GB, or more, but the number is easy to misunderstand. RAM is not the same as permanent storage. It is fast working memory that the system uses while applications, documents, browser tabs, and background services are active. More RAM can make a device handle heavier workloads more comfortably, but adding memory does not automatically make every task faster. The useful question is whether your workload regularly needs more memory than the device can provide efficiently.