

1·
4 days agoIf you’ve eg. a system service that allocated a whole pile of memory on startup, but hasn’t read or wrote it since, then copying it to swap during idle disk time is a good thing. If it does get used, then it’s still in RAM, and if memory pressure increases, then you can reuse it immediately because it’s already on disk, don’t have to wait to swap it out. You could give this functionality a catchy name like ‘swappiness’ so you could fine-tune how aggressively it’s done by setting the value in a file, too.
Doesn’t stop Windows being a trash OS, of course, but if I’ve allocated swap then I want it to be used for best system performance.
Indeed. Don’t comment “what”, only comment “why”. If you’ve written code that looks like a mistake but is there for a reason - poor algorithm, not idiomatic, etc. - then the proper “comment” is a unit test that exercises the business logic behind it, but a one-liner to stop someone from “fixing” it is maybe polite too. Don’t write an essay for private functions; rename them so they’re obvious.