Hacker Newsnew | past | comments | ask | show | jobs | submit | quectophoton's commentslogin

Something I've never understood is why, say, 60GB RAM + 4GB swap is supposed to be faster than 64GB RAM + no swap. Or why 64GB RAM + 4GB swap is supposed to be faster than 68GB RAM.

I get the hibernation argument, but not the arguments implying swap is always better.

Actively using 60GB RAM and moving 4GB of unused pages to swap (60+4), is somehow faster than actively using 60GB RAM and keeping unused pages in the remaining 4GB RAM (64+0)?

EDIT: If you prefer more round numbers, feel free to replace them with "32GB RAM + 32GB swap" and "64GB RAM + no swap" respectively.


The actual choice is 32GB RAM + 32GB swap or 32GB RAM + no swap. This is because people already bought their RAM and disks by the time they make the decision, and aren't using the whole disk.


I mentioned this in a response[1] to a sibling comment, but my question is more about learning what are the advantages of swap itself, other than just cheaper slow RAM.

What does the OS do differently with swap vs RAM? What can I do with swap that I cannot do with RAM? Things like that.

[1]: https://news.ycombinator.com/item?id=49670574


Nothing besides having more of it. Apparently also hibernation, but that's more of an artificial limitation - there's no good reason a system couldn't create a hibernation file on demand.


I’m not sure I understand. In your equations, why is swap taking away from RAM? It’s purely additive.

Say you have 64GB of RAM, of which 4GB are dirty pages that are never, or at least very rarely, accessed. With 64GB RAM + 4GB swap, you filled up your swap with them and have 64GB RAM left to use actively. With 64GB RAM + 0GB swap, you only have 60GB RAM left to use actively.


In my examples nothing is taking away from nothing, I'm just asking if, if two situations have the same total amount of GB, what's the actual difference between RAM+swap vs entirely RAM.

Use the 32+32 numbers if you're more comfortable with those round numbers.

If I have a system running comfortably with 32GB RAM + 32GB swap (no OOM, no swap thrashing), and I upgrade to 64GB RAM + 0 swap, what actual negative effects would I be getting for the lack of swap?

That's my question, to know if swap has any benefits other than being additional slow RAM.


Adding 32GB of RAM is vastly better than adding 32GB of swap, it’s not even close. However, it’s also vastly more expensive. That has always been the case, not just in the current insane situation.

We use swap because we have plenty of disk space, but (comparably) very little DRAM.

The same goes for another level on the hierarchy: If you could choose between 1GB of DRAM vs. 1GB of SRAM (which your CPU cache is), you’d definitely choose the SRAM. But you’d be paying out of your nose both with money and area, it’s not economical at all. My CPU has 96MB of cache, and that’s considered massive.


Reading charitably, when writing that part of the comment they probably were thinking of links that look like buttons, for example the "Get started" link in Tailwind's home page.

Regardless of how that specific one looks like, I wouldn't like if it were replaced by a <button>.


I don't know what's wrong with me, but I can't do mental calculations with dates because I always think I'm off-by-one, no matter what.

I prefer to "move vertically" in the month. Knowing that 1=8=15=22=29, using prlin's example for December 25 (sibling comment), I'd go like:

"12 is Saturday, 15 is Tuesday, 22 is also Tuesday, so 25 is Friday."

So, starting from key date (12), moving to "the 1 column" (15), moving up or down to the closest/easiest date (22), and then finishing from there.

Slower for sure, but easier for me to not lose track. And now having a known day in every month thanks to rmunn's mnemonic, is going to be a huge help.


Just to clarify, I didn't invent this. I don't think you were attributing it to me when you said "rmunn's mnemonic", I think you meant "the mnemonic that rmunn posted". But just in case anyone thinks I invented this, I didn't. I don't remember where I got it from, it was twenty-plus years ago that I learned this mnemonic, but I didn't invent it.


> Points to the future where my bots talk to your bots.

Relevant comic from 2014: https://www.smbc-comics.com/index.php?id=3576


React.js with JSX (which people use to avoid writing HTML) is basically the opposite on its tolerance for mistakes but somehow it seems pretty popular, to say the least.


JSX is a little pickier about structure, but doesn't give much care towards conformance, which is where the bulk of HTML violations occur. I expect close to 98% of React output is also invalid, which is why users are using React and not something like Qt.


Parent post already told you a way to distribute your software to Linux users; assuming your tarballs with prebuilt binaries "just work", as in, it's enough to untar it wherever (/opt?) and create a symlink in $PATH for your executable.

But from your comments, the message I get is that you want to apply to become a maintainer in each and every Linux distribution's package repositories, both mainstream and niche? And apparently also create packages for some alternative package managers too? (e.g. mise, npm, Terra)


Tangential but still related to that story, but the battle for the meaning of "REST" is already lost.

Saying an API follows REST but doesn't implement HATEOAS (part of its definition), is like saying a database follows ACID but doesn't implement Atomicity. Or like saying a software is Open Source but doesn't allow use for commercial purposes.

Yet somehow for one of those 3 cases it became accepted to misuse the term that way ("[original meaning] but without this one constraint"), but if someone misuses the term for the other two cases then everyone suddenly cares and insist that people should use a different term to describe their thing.


Online typing speed tests are in a really good position to collect and sell this data, if they aren't already doing it.


Typing speed tests are not likely to end up reflecting typical typing patterns, though.


> Similar to how us vim users keep updating/rewriting our config.

What (or why) are those frequent config changes?

I use neovim and I can say I've migrated[1] to vim packages (from Pathogen) years ago, and I also git-clone a repo once every few years if I want LSP support for a language I haven't used before.

But I wouldn't call this "keep updating/rewriting".

[1]: By removing a line from my config, and then running `mv` once.


It really seemed more in vogue in 2011ish, Command-T and nerdtree era


As far as I understand, everything ends up centralized to USA anyway (ICANN), who then tells everyone what TLDs are allowed or not.


If ICANN removed a country TLD it would be an international incident that would break the internet in two - USA and everyone else.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: