Live data from Hacker News

FreeBSD ate my RAM

crocidb.com

51–60 of 89 posts

Re: FreeBSD ate my RAM

#51

I wonder if these btop fixes got into the standard ports collection? Or even upstream? I like the command for viewing the ARC cache size, never knew that. It's only 2GB on my system (of 64GB RAM).

>I like the command for viewing the ARC cache size

zfs-stats is also nice for more zfs internals like hit-rate L2 etc..

https://www.freshports.org/sysutils/zfs-stats

Re: FreeBSD ate my RAM

#53
post #33

Earlier quoted context omitted.

The thing is it's easy to define free, unused memory. But a lot of the used memory is your system caching stuff that would be free if you needed more than what's actually free. So you can see you have 1g of free memory out of your 4g, but then you allocate 3g and it will do without a sweat and you'd be confused. So you have to go and dig for what those caches are and report that they're effectively free too.

Instantly reclaimable disk caches should count as available, and they do. This isn’t hard. The OS should just expose a counter for available memory instead of having applications understand every type of memory reservation. edit: Linux does this, but it has its own share of issues with memory counters. The “cached” memory includes tmpfs and ramfs for seemingly no reason.

Linux MemAvailable from /proc/meminfo is just an estimation calculated as an arbitrary percentage (50%) of free and potentially reclaimable memory.

You can't determine how much of the memory can actually be reclaimed under memory pressure until you try to reclaim it.

Re: FreeBSD ate my RAM

#54
As for the “unauthorized” sign:

Book publishers used to print India/SEA-only editions of books only sold in those countries, significantly cheaper than in the US or Europe. Then a Thai guy realized that this would be a good business opportunity: buy cheaper books and then import them to the US. Wiley brought him to court, went to the SCOTUS, Wiley lost the case. So they ended up printing cheaper edition books.

https://en.wikipedia.org/wiki/Kirtsaeng_v._John_Wiley_%26_So....

Mind you "price discrimination" like this still exist in the digital world where locality is easier to be enforced. For example Steam has extensive regional pricing across countries so the same game can be significantly cheaper in Russia, India, Brazil etc. compared to US or EU

An example: https://steamdb.info/app/413150/

https://partner.steamgames.com/pricing/explorer

https://partner.steamgames.com/doc/store/pricing/currencies

Re: FreeBSD ate my RAM

#56

I don’t understand the part about using heuristics and deciding what counts as used memory… Used memory for the system is always total minus available. Heuristics? I would hope that the system knows precisely what is using every single byte of physical and virtual memory. Is this a reporting problem? Why do we have to settle for heuristics and not the exact number?

You will be surprised by how inaccurate memory measurements are.

Not after reading this article. :-)

Re: FreeBSD ate my RAM

#57

Earlier quoted context omitted.

> The “cached” memory includes tmpfs and ramfs for seemingly no reason. If you're curious why that is by the way, it's because that's actually how these are implemented (tmpfs/ramfs is just a mount to a filesystem where the files never get marked clean[1]) [1]: https://www.kernel.org/doc/Documentation/filesystems/ramfs-r...

That’s clever. Makes for terrible UX, though. AFAIK the only way for you to figure out how much of your disks is actually cached involves enumerating all tmpfs and ramfs mounts, summing their sizes, and subtracting the sum from the cache size reported by the kernel.

Well, what's the alternative? Invent a new type of memory reservations specifically to account for tmpfs/ramfs mounts? That'd violate your own stated desired goal of

> The OS should just expose a counter for available memory instead of having applications understand every type of memory reservation.

Re: FreeBSD ate my RAM

#58
post #54

As for the “unauthorized” sign: Book publishers used to print India/SEA-only editions of books only sold in those countries, significantly cheaper than in the US or Europe. Then a Thai guy realized that this would be a good business opportunity: buy cheaper books and then import them to the US. Wiley brought him to court, went to the SCOTUS, Wiley lost the case. So they ended up printing cheaper edition books. https:…

    When Kirtsaeng moved to the US in 1997 to pursue an undergraduate degree in mathematics at
    Cornell University,[4] he discovered that textbooks (not just those published by Wiley, but
    of other publishers too) were considerably more expensive to buy in the United States than
    in his home country. Kirtsaeng asked his relatives from Thailand to buy such books at home
    and ship them to him to sell at a profit. He sold the imported books on eBay, making $1.2
    million in revenue, although the parties disputed the net profit amount.
A text book case (ha!) about one of the mechanisms that enable the free markets and trade to bring the prices of goods down.

Re: FreeBSD ate my RAM

#59

I wonder if these btop fixes got into the standard ports collection? Or even upstream? I like the command for viewing the ARC cache size, never knew that. It's only 2GB on my system (of 64GB RAM).

Ports is on 1.4.7.

* https://freshports.org/sysutils/btop/

The fix is still pending being even made to the origin version.

* https://github.com/aristocratos/btop/pull/1728

Re: FreeBSD ate my RAM

#60
post #2

Interesting post, it made me wonder. At one time FreeBSD swap usage/logic was far better than what Linux did. Is that still the case ?

I remember how NetBSD promoted itself as running on many more toasters than Linux once. Then some NetBSD dev wrote on their mailing list that this is no longer true. Linux runs on more toasters now. (And also top 500 supercomputers, but toasters are the real metal to the petal test.) These fights always remind me of: https://www.jwz.org/doc/worse-is-better.html It's an interesting piece of history too. I kind of eval…

> but toasters are the real metal to the petal test.

Or is that a new tongue in cheek idiom?

AFAIK, it’s peDal, not peTal, and the other way around: pedal to the metal. The literal meaning is to push your accelerator pedal down to the floor of your car, which is made of metal.

Post reply on HN