Vai al contenuto principale

#memory

Hmmm... I wanted to um, remember this write up as more than a bookmark yet less that a full re-blog/re-post, without a favourite.

Ergo this quote-pos

Altro...

Hmmm... I wanted to um, remember this write up as more than a bookmark yet less that a full re-blog/re-post, without a favourite.

Ergo this quote-post.

|

#memory #ram #ssd #hackaday

Your Computer Memory is a Lie

When you first learn to program, memory seems pretty straightforward. You have a bunch of bytes, each with an address. If you want to read or write so

Altro...

When you first learn to program, memory seems pretty straightforward. You have a bunch of bytes, each with an address. If you want to read or write something, you specify the address, and the computer goes to that place and does your bidding. Sure, some addresses might be reserved for hardware or the operating system, but the general idea is simple: memory is a big array of bytes.

Just like we pretend that a wire is a perfect conductor, the big array of memory model used to be a slight twisting of the truth. On a modern computer, however, it is almost entirely a lie. The address you use probably isn’t a physical address. The data you read might not come from RAM at all. Even if it does, it might be sitting in one of several caches. And if you follow the rabbit hole far enough, you discover that your SSD is arguably just another level in the memory hierarchy.

The Need For Speed
The fundamental problem is that processors have gotten much faster than memory. A modern processor can execute several instructions per clock cycle, but accessing ordinary DRAM can take hundreds of cycles. If the processor had to wait for RAM every time it needed data, much of that impressive computing power would go to waste.

The solution is caching. Keep copies of frequently used data in smaller, faster memories closer to the processor. Most modern desktop processors have at least three levels of cache. The L1 cache is tiny but extremely fast, and often split between instructions and data. L2 is larger and somewhat slower, while L3 is even larger and usually slower as well.

Things get interesting with multiple cores, as is often the case these days. Typically, each core has its own L1 and L2 caches, while several cores share an L3 cache. But that’s not universal. Some processors share L2 caches between cores. Others have multiple L3 caches, each serving a group of cores. The exact arrangement depends on the processor architecture.

One important detail: caches don’t generally work byte by byte. They transfer and track blocks called cache lines, commonly 64 bytes on modern desktop processors. If you read one byte that isn’t cached, the processor generally fetches the entire line containing that byte.

This is why sequential memory access is often much faster than random access. If you read the next byte, there’s a good chance it’s already in the cache. Hardware prefetchers may even anticipate what you’ll need next.

But there can be problems. Imagine two cores modifying completely different variables. If those variables happen to occupy the same cache line, the cores may repeatedly invalidate each other’s copies, wasting time even though they aren’t logically sharing data.

Protocols such as MESI keep the caches coherent, coordinating which core owns a line and which copies are valid. MESI is an acronym for cache line states: modified, exclusive, shared, or invalid. Memory systems must figure out how to keep caches in sync. But coherence doesn’t eliminate the need for synchronization or memory-ordering rules in multithreaded programs. The point is that even our simple byte-addressed memory is secretly operating in larger chunks.

The Address Isn’t Real, Either
So far, we’ve assumed that the address you supply identifies a location in RAM. Usually, it doesn’t. Modern operating systems use virtual memory. Your program sees a virtual address space that the operating system and processor cooperate to map onto physical memory.

The memory management unit, or MMU, translates virtual addresses into physical addresses, typically using page tables. This lets different programs use identical virtual addresses without interfering with one another. It also provides memory protection and allows physical pages to be shared.
Of course, translating addresses takes time. So we add another cache.

The translation lookaside buffer, or TLB, remembers recently used address translations. A TLB hit avoids a potentially expensive page-table walk. Some processors even have multiple levels of TLBs. Unlike the ordinary CPU cache, which generally operates on cache lines, virtual memory usually works with pages, often 4 KB, although larger pages are also supported.

Notice what’s happening. We have caches for data, caches for instructions, and caches for the information needed to locate the data and instructions.
The simple act of reading a variable has become surprisingly complicated.

Not All RAM Is Created Equal
Even if we get through the caches and finally reach RAM, things aren’t necessarily simple. On systems with multiple processors or certain multicore arrangements, memory access can be non-uniform. This is called NUMA, or Non-Uniform Memory Access.

A processor may have relatively fast access to memory attached to its own NUMA node, while accessing memory associated with another node requires crossing an interconnect. Both locations are ordinary RAM, and both may appear in the same address space, but the access times and available bandwidth can differ.

The operating system tries to place memory near the processors using it. Moving a thread to another CPU can therefore change its memory performance, even though the program’s addresses haven’t changed.

And NUMA isn’t limited to traditional multiprocessor servers. Modern systems with chiplets, heterogeneous memory, and technologies such as CXL are making memory topology increasingly interesting.

What If It Isn’t In Memory?
Virtual memory has another trick. A virtual page doesn’t necessarily have to be backed by physical RAM at the moment you access it.

When a program accesses a page that isn’t currently mapped in a usable way, the processor generates a page fault. The operating system decides what to do. Sometimes it simply allocates a fresh page. Sometimes it retrieves data from an executable or memory-mapped file. Other times, the page was moved out of RAM to swap space and must be retrieved. Note that things like executable data are generally immutable, so most operating systems won’t swap them out. They simply trash them and know they can reload the same page later when needed.

This means your program can address data that isn’t presently in physical memory. Naturally, accessing an SSD is much slower than accessing RAM, so excessive swapping can bring a computer to its knees.

Virtual memory doesn’t actually require swapping, though. Address translation and protection are useful even on systems that never move pages to disk.

Your SSD Is Memory, Too
Suppose your program reads a file. You might imagine that the operating system sends a request to the SSD and waits for the data. But if the file was recently accessed, the data may already be in RAM.

Operating systems maintain a filesystem page cache, keeping frequently or recently accessed file data in memory. Writes may also be buffered in RAM before eventually reaching persistent storage.

This makes RAM act like a cache for secondary storage, much as L3 acts like a cache for RAM.

The analogy isn’t perfect. RAM is also the primary working storage for running programs, and anonymous memory isn’t necessarily a copy of anything on disk. But the general hierarchy is clear: registers, CPU caches, RAM, and persistent storage provide progressively different tradeoffs between speed, capacity, and cost.

Even SSDs have their own caches and address translations. Their flash translation layers map logical block addresses onto physical flash locations, hiding wear leveling and garbage collection from the host. Apparently, nobody wants to tell the truth about addresses.

Compressing The Middle
But what if we could make RAM effectively larger without adding more? Compression offers another way to complicate our memory hierarchy. Instead of immediately moving an infrequently used page to disk, why not compress it and keep it in RAM?

Linux has two well-known mechanisms for doing this: zram and zswap. Zram creates a compressed block device in RAM. It’s commonly used as a swap device, allowing pages to be stored in compressed form rather than written to physical storage.

Zswap, on the other hand, is a compressed cache in front of a swap device. When Linux decides to swap out a page, zswap attempts to compress and retain it in RAM. If necessary, pages can eventually be evicted to the backing swap device.

Both trade processor time for memory capacity and reduced storage I/O. Decompressing a page costs CPU cycles, but that can be considerably cheaper than retrieving it from an SSD.

There’s a catch, though. These mechanisms operate through the swap subsystem. When a compressed page is needed again, it must be decompressed into an ordinary page before the program can access it. That means page faults, memory management overhead, and moving data around. But what if compressed memory could behave more like ordinary RAM?

Meta Wants To Change The Rules
That’s the idea behind CRAM, or Compressed RAM, a project presented by Meta’s Gregory Price at the October 2026 Linux Plumbers Conference.

Rather than treating compressed memory as a conventional swap device, CRAM proposes exposing it through a special NUMA node. Linux can then use existing memory-management mechanisms to move pages between ordinary DRAM and compressed memory. The most interesting part is the hardware-assisted compression and decompression, which allows access at much finer granularity than conventional page-oriented compressed swap.

The developers report impressive benchmark results, including read performance that approaches ordinary DRAM in some tests and dramatic improvements over zram for selected workloads.

That doesn’t mean compression has suddenly become free. Writes, compression ratios, hardware requirements, and managing incompressible data all matter. CRAM is still developmental work, not ready for everyday use.

But it illustrates where the memory hierarchy is heading. Instead of simply deciding whether a page is in RAM or on disk, the operating system may choose among ordinary RAM, compressed memory, slower memory tiers, and secondary storage.

The Illusion Is The Feature
Most programmers don’t need to think about any of this most of the time. That’s the point of an abstraction. But when performance matters, the illusion starts to leak. Sequential access can beat random access by enormous margins. Two threads modifying unrelated variables can fight over cache lines. Moving a process between CPUs can change its memory latency. A page that looks like ordinary memory might actually require decompression or a trip to an SSD.

On smaller embedded systems, of course, the picture may be very different. Without an MMU or elaborate caches, memory can look much more like the simple physical address space we learned about in the first place.

We started with an array of bytes. We ended up with a hierarchy of caches, translation tables, NUMA nodes, compressed memory pools, and persistent storage devices, all cooperating to maintain that simple illusion. Amazing how complicated something so simple can be.

hackaday.com/2026/10/12/your-c…

0

Caricamento...

0
0

Caricamento...

"It is not paranoia when they have told you in advance what they intend to forget."

The dates of the surgeries, the names of the doctors, the letters

Altro...

"It is not paranoia when they have told you in advance what they intend to forget."

The dates of the surgeries, the names of the doctors, the letters, the receipts in a fireproof box on the floor of a closet in a house on red Georgia clay.

Cumaidh sinn cunntas — we will keep count.

https://thistleandmoss.com/p/count-the-motherfuckers-back-a-stolen-election-1-6-million-photographs-and-124-graves#heroes-bright-signals-the-ones-who-?utm_source=PixelFed&utm_medium=social&utm_campaign=fedica

Close-up selfie of a person wearing glasses and a gray patterned headscarf, with dark hair visible and a green patterned shirt. The background is dark and out of focus.

#privacy #photography #journalism #druid #georgia #quotes #lgbtq #trans #queer #memory #solidarity #transrights #gaelic #resist #surveillance

0

Caricamento...

0
1

Caricamento...

Des photos du 11 septembre 2001, en mémoire de cet évènement
Attention certaines sont très prenantes

A few photos from September 11, 2001, in memory

Altro...

Des photos du 11 septembre 2001, en mémoire de cet évènement
Attention certaines sont très prenantes

A few photos from September 11, 2001, in memory of that event.
Please be advised that some of these images are very emotionally distressing.

https://www.gettyimages.fr/photos/11-septembre-2001

#photography #photos #memory #11septembre #11september #memoire

0

Caricamento...

0
1

Caricamento...

Recollections
Heartfelt somber memories
Our innocence lost

/11

Altro...

Recollections
Heartfelt somber memories
Our innocence lost

/11

September 11, 2026

Color image of a graphic depicting the 2,977 lives lost 11 September 2001 at New York City's World Trade Center, the Pentagon in Washington, D.C., and on a farmer's field in Shanksville, Pennsylvania. Image shows depictions of each place accompanied by descriptions of each of the locations, the lives lost at each, with a closing of "Never Forget - Today and Always" at the bottom of the image.

#photography #usa #writingcommunity #summer #haiku #onehaikuaday #writerscollective #backtohaiku #world #memory #memorial #september #september11 #innocence #lives #911memorial

2

Caricamento...

0
3

Caricamento...

tattered boat bag6-link
(C) Paul David Mena @extraspecialbitter@indieauthors.social & Nara Moore @NaraMoore@sakurajima.moe
(C) Photo: Paul Da

Altro...

tattered boat bag6-link
(C) Paul David Mena @extraspecialbitter@indieauthors.social & Nara Moore @NaraMoore@sakurajima.moe
(C) Photo: Paul David Mena 2026 - San Pedrito surf break at low tide in El Pescadero, BCS, Mexico, circa 2013.

#

tattered boat bag

6-link #Rengay
(C) Paul David Mena @extraspecialbitter@indieauthors.social & Nara Moore @NaraMoore 
(C) Photo: Paul David Mena 2026 - San Pedrito surf break at low tide in El Pescadero, BCS, Mexico, circa 2013. 

the old beachcomber
leaving no footprints
in the sand

Whistling wind combeth
not his graying locks 

there's always room
for another seashell
in his tattered boat bag

If no one hears the whistling 
Of the conch in the bag...
Walking out at low tide

crowding the sand flat
an argument among plovers

Wander among them
The sailor's vague memory
Unseen and hardly felt

#photography #写真 #マストドン写真部 #beach #poetry #sea #dailyhaikuprompt #seaside #rengay #詩 #nmpoetry #haiga #俳画 #mexico #memory #shell #lowtide #wss366 #sanpedrito #elpescadero

6

Caricamento...

0
6

Caricamento...

The best part of curating one's old photos is discovering forgotten memories. Here are Jeanne and Cyndi in a Mifflintown parade with the Brownie Tro

Altro...

The best part of curating one's old photos is discovering forgotten memories. Here are Jeanne and Cyndi in a Mifflintown parade with the Brownie Troupe they led in the 1970s.

#photography #photo #photographer #photos #memories #photographers #smalltown #parade #memory #photographs #oldphotos #oldphotographs #curatingphotos #curatingphotographs #remembering #1970s #brownies #brownietroupe #brownietroupes #brownieleader #brownieleaders #smalltownlife #smalltownliving #mifflintown

3

Caricamento...

0
1

Caricamento...

@glass@mastodon.world ran a highlight for International Dog Day today, and my Juliette is in it 🥰

I didn't expect this at all, thanks to all your wo

Altro...

@glass@mastodon.world ran a highlight for International Dog Day today, and my Juliette is in it 🥰

I didn't expect this at all, thanks to all your wonderful team for this!

Somebody there wrote her name, rest in peace with all the balloons and treats, sweet Juliette, and they linked the series from when she was still here so people could go and look at her.

The photo they picked is the last one I took, the little bag with her ashes and the card with her name on it.

She died eleven days ago and I did not expect any of this to happen.

Thank you @glass@mastodon.world :glass_photo:

https://glass.photo/highlights/international-dog-day

Screenshot of a glass.photo Spotlight page dated August 26, 2026. Large heading "International Dog Day" and the line "We love them. They love us." Three small round buttons for mail, link and Mastodon sit under the heading. The main photograph, credited "Photograph by Seth Boyer", shows a black, white and tan dog on a leash sitting on the front deck of a silver aluminium fishing boat pulled onto a pebbly lake shore, mountains and a blue sky behind it. Boat registration readable as AK 1802AY. Body text begins "We launched our highly requested dog category a few years ago with one word: Finally." Later lines name Juliette and Dmytro: "Rest in peace with all the balloons and treats, sweet Juliette (pictured below). Thank you for sharing your story with us, Dmytro. English text above a photograph. First paragraph: "Dogs have shared so many of our moments as true members of the family. Their importance to us might be hard to quantify, but anyone who's ever bonded with a dog knows exactly how it feels. Even after all her time with chimpanzees, Jane Goodall's favorite animal was her dog, Rusty. No wonder." Second paragraph: "It's International Dog Day, so tell your dog we said "hi."" Below, a black and tan dachshund, Juliette, lying on a pale grey-blue rug on parquet, wearing a pale yellow unicorn party hat with pastel tassels, her muzzle against a white balloon printed with black paw prints. Living room and a bright window behind her. Taken at my son's birthday.

#fediverse #mastodon #photography #dogs #pets #love #health #memory #petsofmastodon #death #juliette #grief #heartdisease #loss

18

Caricamento...

3
3

Caricamento...

Remembering Sea6-link
(C) Paul David Mena @extraspecialbitter@indieauthors.social
& Nara Moore @NaraMoore@sakurajima.moe

Image: Nara Moore

Altro...

Remembering Sea6-link
(C) Paul David Mena @extraspecialbitter@indieauthors.social
& Nara Moore @NaraMoore@sakurajima.moe

Image: Nara Moore

# Remembering Sea

Images: Two plushies on sea rocks
Bottom: Looking across a calm sea and beach at beach rocks.

6-link #Rengay
(C) Paul David Mena @extraspecialbitter@indieauthors.social 
& Nara Moore @NaraMoore 

Image: Nara Moore

Poam:

in my dreams
the ebullience
of ocean waves

Crashing on the dawn
Dunes of present time

beach plum blossoms
remembering
my first love

Hermit crab remembers
Salt mist softens
My last

the ubiquitous starfish 
in a beach house window

Sparkling sea
Echoes of the tide
Sings of you and me

#photography #写真 #マストドン写真部 #poetry #sea #rengay #詩 #nmpoetry #haiga #俳画 #oregon #memory #haikuchallenge #ebullience #plushie

4

Caricamento...

0
3

Caricamento...

Polaroid photography costs $2 per frame in a world where your phone takes thousands for free. The case for it has nothing to do with image quality and

Altro...

Polaroid photography costs $2 per frame in a world where your phone takes thousands for free. The case for it has nothing to do with image quality and everything to do with what photographs are actually for.

https://riftlymedia.com/?p=2925

#photography #technology #culture #identity #memory

3

Caricamento...

1
0

Caricamento...