SShortSingh.
Back to feed

How Operating Systems Manage Memory Between Programs and Hardware

0
·96 views

When a program requests memory, the OS allocates it in fixed-size units called pages, typically 4KB, rather than handing over raw physical RAM. Virtual memory creates an illusion of contiguous space, while the CPU's Memory Management Unit (MMU) maps each virtual page to a physical memory frame scattered across actual hardware. Traditionally, the sbrk() system call managed heap boundaries by moving a 'program break' line, but this approach is now deprecated on modern architectures like ARM64 and RISC-V. Modern memory allocators instead use mmap() to request memory pages directly from the OS, avoiding the fragmentation problems that plagued the older program-break method. The page-based system also provides security and efficiency benefits, isolating processes from each other and enabling the OS to swap unused pages to disk when physical RAM runs low.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

GitHub Actions OIDC lets cloud deploys drop stored keys, but trust conditions decide safety

GitHub Actions can replace a stored cloud access key with OIDC, where GitHub signs a short-lived token for each job that AWS, Google Cloud or Azure exchange for temporary credentials. The security depends entirely on the trust conditions written on the cloud side, since every GitHub repository can obtain a token from the same issuer. Conditions should bind to stable identifiers such as repository ID, a protected environment with required reviewers, or a reusable workflow, rather than a wildcard organization name. The default subject claim format has a weakness: recycled repository or organization names could let a new owner mint matching tokens, so newer repositories use an immutable format that includes numeric IDs. Older repositories must opt into that format through their OIDC settings or the REST API.

0
ProgrammingDEV Community ·

Moving Jenkins Pipelines to GitHub Actions: What Maps Directly and What Needs Rewriting

The article explains how to migrate Declarative Jenkinsfile pipelines to GitHub Actions by translating directives one by one, such as agent becoming runs-on and when becoming if. It notes that plugin steps, shared libraries and Groovy script blocks cannot be converted automatically and must be rebuilt by hand. It recommends moving simple build-and-test pipelines first and deploy pipelines last, keeping the Jenkins job running until the new workflow produces matching results. A key warning is that each GitHub Actions job runs on its own fresh machine without a shared workspace, which changes behavior more than the syntax does. The piece presents a mapping table of sixteen constructs, flagging which convert cleanly and which change how the pipeline behaves.

0
ProgrammingDEV Community ·

Private Originals and Purchase-Gated Downloads for Creator Portfolios

The article recommends keeping every original image in private storage and serving only compressed, resized, or watermarked derivatives to public portfolio visitors. Each completed purchase should be checked against a durable purchase-to-asset record before the application issues an expiring URL for the original. The design relies on random internal asset identifiers rather than filenames or client-supplied keys to determine entitlement. It also specifies that transformation failures must fail closed instead of falling back to the original file. The author suggests a single REST-based service could cover both image processing and private object access, though the evaluation rests on the author's own judgment.

0
ProgrammingDEV Community ·

GitHub Actions runner specs differ by repository visibility and runner label

GitHub-hosted Actions runners provide different CPU and memory depending on whether a repository is public or private, even when the workflow YAML is identical. For example, a standard Linux runner gets 4 vCPU and 16 GB RAM on a public repo but only 2 vCPU and 8 GB on a private one. Standard runners all come with 14 GB of disk regardless of size, while larger paid runners offer between 75 GB and 2 TB. Larger runners are billed per minute and draw on plan compute on Team and Enterprise Cloud, and they can also be given static IP addresses. The article's specification tables were read on 2026-09-20 and the runner tiers and deprecation dates it references may change.