frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

GhostMem: User-space virtual memory compression for C++ using LZ4

https://github.com/el-dockerr/ghostmem
2•el_dockerr•1h ago

Comments

el_dockerr•1h ago
Hi HN,

I wrote a C++ library that implements transparent memory compression in user-space. Up to 100% if you use it right ^^

The core idea is to catch memory access violations (using AddVectoredExceptionHandler on Windows or userfaultfd/Signals on Linux) to implement a custom paging mechanism. Instead of swapping to disk, it compresses cold pages using LZ4 and stores them in a reserved heap area.

How it works:

It allocates virtual memory but sets protections to PAGE_NOACCESS.

When the app tries to access the memory, the library catches the CPU trap.

It allocates physical RAM, decompresses the data (if it existed), and resumes execution.

An LRU strategy freezes cold pages back to the compressed store when a limit is reached.

Why? Aside from the technical challenge, my main use case is embedded/IoT systems (like Raspberry Pi). Swapping to SD cards kills them quickly due to write wear. By compressing in RAM, we can extend the lifespan of the hardware and prevent OOM kills in constrained environments without touching the kernel. And you can set it up to store memory right on the IO of the Harddrive instead. So you have a application that make use of no ram (mostly).

In future it will add an optional AES-128 encryption layer for "ephemeral security" (data is encrypted while cold).

It's a PoC / Alpha right now. I'd love to hear your thoughts on the implementation or potential edge cases with specific C++ STL containers.

Link to code:https://github.com/el-dockerr/ghostmem

DenisDolya•42m ago
Nice project! One question: decompression and page-fault handling also add latency. How do you avoid thrashing in practice? Also, for such low-level memory management, why C++ instead of C? C might give more predictable control without hidden runtime behavior.

First risk assessment of Moltbook – a social platform exclusively for AI agents

https://zenodo.org/records/18444900
1•sushant_gautam•2m ago•1 comments

Machinery and English Style (1904)

https://www.theatlantic.com/magazine/archive/1904/10/machinery-and-english-style/637506/
1•danidiaz•9m ago•0 comments

vibebin: code and host inside LXC (Incus) containers on your own VPS/server

https://github.com/jgbrwn/vibebin
1•indigodaddy•12m ago•0 comments

Construction of ESA's ambitious LISA mission begins

https://www.esa.int/Science_Exploration/Space_Science/LISA/Construction_of_ESA_s_ambitious_LISA_m...
1•zeristor•13m ago•0 comments

The Evidence: A Record of Observed Behaviour in External AI Systems

https://www.aivojournal.org/the-evidence-a-record-of-observed-behaviour-in-external-ai-systems/
1•businessmate•13m ago•1 comments

Show HN: Tesla Model Y Juniper First Drive

https://xthe.com/news/tesla-model-y-juniper-first-drive/
1•xthe•18m ago•0 comments

Show HN: I built a tool that generates 22-page competitor reports from your URL

https://champsignal.com/competitive-intelligence-report
1•maximedupre•20m ago•1 comments

OpenClaw: When AI Agents Get Full System Access. Security nightmare?

https://innfactory.ai:443/en/blog/openclaw-ai-agent-security/
1•i-blis•20m ago•0 comments

European and allied cybersecurity strategies shift from defence to offence

https://bindinghook.com/how-european-and-allied-cybersecurity-strategies-are-shifting-from-defenc...
1•campuscodi•22m ago•0 comments

Disgraced Crypto CEO Sam Bankman-Fried Seeks Trump Pardon with Republican Pivot

https://gizmodo.com/disgraced-crypto-ceo-sam-bankman-fried-seeks-trump-pardon-with-republican-piv...
6•pseudolus•26m ago•1 comments

Why I'll Never Drive a Modern Car Again [video]

https://www.youtube.com/watch?v=lEE2-QVnmTU
1•f311a•26m ago•0 comments

A simple HTTPS, HTTP/3, SSL and security headers checker I built with AI

1•dragonman•26m ago•0 comments

DuckDB Performance: File Formats

https://duckdb.org/docs/stable/guides/performance/file_formats
1•tosh•26m ago•0 comments

Leveraged Buyouts Are the Government's Fault

https://deadneurons.substack.com/p/leveraged-buyouts-are-the-governments
1•nr378•27m ago•0 comments

Open-source real-time interactive world model (LingBot-World)

https://www.lingbot-world.org/
1•awei•28m ago•0 comments

Show HN: Give your OpenClaw agent an email address

https://www.clawhub.ai/heyarviind/clawmail
1•heyarviind2•29m ago•0 comments

Amiga Unix (Amix)

https://www.amigaunix.com/doku.php/home
2•donatj•29m ago•0 comments

Show HN: Convert Step to STL Free Online Tool

https://pngtostl.xyz/convert/step-to-stl
1•niliu123•30m ago•0 comments

Sqldef: Idempotent schema management tool for MySQL, PostgreSQL, SQLite

https://sqldef.github.io/
1•Palmik•30m ago•0 comments

Show HN: I built theme support in Tabularis – lightweight DB tool for developers

https://github.com/debba/tabularis
1•debba•30m ago•0 comments

Ask HN: Cheap, powerful AI programming now, what happens when we have no choice?

1•andrewstuart•32m ago•0 comments

Investigation alleges Meta has gained billions from fraudulent social media ads [video]

https://www.youtube.com/watch?v=Et-TOT5wzoE
2•mgh2•32m ago•1 comments

Show HN: Infiltrate Moltbook, the AI-Only Social Network

https://github.com/fritzprix/moltbook_break
1•72ave2•33m ago•0 comments

Wave 14: Arena Mode – May the Best Model Win

https://windsurf.com/blog/windsurf-wave-14
1•tosh•34m ago•0 comments

The Feeling of Power (1958)

https://en.wikipedia.org/wiki/The_Feeling_of_Power
2•_alaya•37m ago•0 comments

Listen to Understand

https://talk.bradwoods.io/blog/listen-to-understand/
1•bradwoodsio•37m ago•0 comments

The Story Behind ECMAScript 4 (2017)

https://auth0.com/blog/the-real-story-behind-es4/
1•m132•37m ago•0 comments

Minute Maid to Discontinue Frozen Orange Juice from Concentrate This Year

https://www.cbc.ca/news/business/minute-maid-discontinuing-frozen-juice-9.7065520
2•bookofjoe•39m ago•1 comments

A single line code change that allows AI agents to learn on the job

https://www.versanovatech.com/docs.html
2•gauravsc•41m ago•0 comments

Microsoft Advises Renaming .exe to .docx in Outlook

https://support.microsoft.com/en-us/office/blocked-attachments-in-outlook-434752e1-02d3-4e90-9124...
4•gabia•41m ago•2 comments