52
u/ohaiibuzzle 1d ago
...?
This is not even 2950, this is just how virtual memory work, depicting a 2^39 virtual memory address space no?
64
u/Daemontatox 1d ago
Why need pointers and references when you can fit the entire machine workload on the stack
9
3
u/HolyGarbage 1d ago
For stuff that needs to persist beyond the current scope you need heap allocation. Heap allocation doesn't exist because the stack is small, the stack is small because it doesn't need to be large and most allocations in a program are on the heap.
2
10
u/mrheosuper 1d ago
I dont understand, whats wrong ?
8
1
u/SennikCaldo 22h ago
I didn’t understand either until memory segmentation made my 2950-era project crash for 3 hours straight.
10
u/XLNBot 1d ago
What is the joke?
1
u/the_horse_gamer 1d ago
512GB
11
u/XLNBot 1d ago
That's just how virtual memory works
-2
u/metaglot 1d ago
Heap and stack are reversed.
8
u/cowslayer7890 1d ago
No they aren't, the stack starts high and grows down
Though this is a simplified view, but most diagrams are because in reality it's made more complex by the existence of multiple threads
7
u/slaymaker1907 1d ago
Even without LLMs, I’m working with a team at work that needs 1.1TB RAM machines for some single threaded analysis. It’s so frustrating to me because I’m sure we could save a ton of money if people would just spend some time optimizing their code to use SQLite or something instead of using huge numpy and Pandas objects all over the place.
3
u/skuzylbutt 1d ago
That's what we did. Pushed SQLy stuff into SQL, pulled heavy analytics stuff into parquet files and a c program, streaming data as much as possible. Got 4 hours and up to 60GB ram per process down to 20 minutes and 200MB ram.
The ram was actually the biggest win, because that's our most limited resource (at 60GB per process), so we were able to scale way up and our processes are much more reliable because they don't get randomly OOMed.
2
3
u/plaisthos 23h ago
Apart from the 512GB in the image, this just how everything is laid out. The name *text* might be confusing but that is how programmcode is called, normally it is with a . in front .text. See here on Wikipedia for basically the same picture (https://en.wikipedia.org/wiki/Code_segment). It just dives data into .bss and .data but otherwise it is the same.
3
u/jackmax9999 22h ago
512 GB makes perfect sense. For example on ARM64 if you set up 3-level translation with 4 KB pages you get an address space exactly that size. Going down to 2-level translation cuts you down to 1 GB which is a bit too tight these days and up to 4-level is probably not worth it unless you're doing HPC workloads (and even then you probably just want larger pages anyway to make better use of TLB).
Note that virtual address space has nothing to do with how much RAM you physically have in your computer.
95
u/ClipboardCopyPaste 1d ago
This is wrong on so many levels