HACKER Q&A
📣 shivajikobardan

Do programmers view memory as pages?


Since paging is the widely used technique in Memory Management. Do programmer's view memory as a set of pages? This sounds very weird to me lol. For example: I have never ever had found a java dev who thinks in pages for memory. Segmentation seem more useful for programmer's view. But segmentation in Memory Management was not used anymore and was obsolete.

Is there something like a precursor to paging? something like WAF that stands ahead of paging to abstract the view to software engineer?


  👤 stop50 Accepted Answer ✓
Pages exist because to reduce the amount of managment and for easier alignment the total space was segmented into pages. Before that prigrams accessed the ram as if all of it was theirs. After the mmu was introduced it was changed into pages we know today.

👤 checker659
The concept of pages is baked deep into the memory hierarchy (cache, TLBs). What exactly do you mean by precursor? I imagine you're thinking of pages as an abstraction over something more fundamental (?).

👤 JohnFen
It depends on the system. If I'm programming on a system that uses a segmented memory architecture of some sort (including bank switching), then I view memory as a set of pages. Otherwise, I don't.

I don't have some sort of "general" view on this. It entirely depends on the architecture of the system I happen to be working with.