HackerTrans
TopNewTrendsCommentsPastAskShowJobs

bzbarsky

no profile record

comments

bzbarsky
·5년 전·discuss
> and that you should be doing only stuff you enjoy

This seems like quite the assumption.

My baseline assumption for a functional relationship would be that the partner that has the least time to help with housework would try to pick up the parts of it that the other partner least enjoys.
bzbarsky
·7년 전·discuss
> Any userspace process can see how low the memory is though

How, exactly?

Or put another way, how do you reliably tell apart "we are seriously thrashing" and "resident memory is getting close to the physical memory limits but there is plenty of totally cold stuff to swap out and it won't be a problem" from userspace? The kernel is the only thing that can make that determination somewhat reliably.
bzbarsky
·7년 전·discuss
> I'd say that if malloc (or equivalent) returns NULL then the system really is out of memory.

That's very much not true when 32-bit processes are involved. You can easily be out of (non-fragmented) address space in a 32-bit process (whether it's all resident or not) while the overall system is nowhere close to being out of memory.

Even in a 64-bit process you can exhaust the address space without being out of memory if you try hard enough; you just have to try much harder.

That said, even on Linux allocators will return NULL when they're just out of address space; there's no overcommit going on there.
bzbarsky
·7년 전·discuss
Based on my experience as a Firefox developer investigating memory usage reports, the worst-performing "normal" web pages in terms of memory have:

1) Lots of script (megabytes). 2) Possibly loaded multiple times (e.g. in multiple iframes). 3) Possibly sticking objects into global arrays and never taking them out (aka a memory leak for the lifetime of the page). 4) Loading hundreds of very large images all at the same time. 5) Loading hundreds or thousands of iframes that all have nontrivial, if not huge, amounts of script. Social media "like" buttons often fall in this bucket.

There are obviously also pathological cases: if your HTML has 1 million elements in it (not a hypothetical; I've seen this happen), memory usage is going to be high, obviously. And arguably having a page with thousands or hundreds of thousands of JS functions is "pathological" too, but it's pretty normal nowadays...
bzbarsky
·7년 전·discuss
The browser _does_ do that. The hard part is detecting "the system is out of memory". Some OSes notify you when that happens, and Firefox listens to those notifications and will flush caches. Some OSes will at least fail malloc and let you detect out-of-memory that way. Linux does neither, last I checked.

Disclaimer: I work on Firefox, but not the details of the OS "listen for memory pressure" integration.
bzbarsky
·9년 전·discuss
> Conversation is action, not thought.

I think the distinction here is a pretty dubious one. Consider, as a hypothetical, a situation in which one can actually tell "what someone else is thinking" based on a more advanced form of EEG. Would it still be "thought" as opposed to "conversation" if two people are doing it to each other simultaneously? Why is transcoding in terms of pixels on a monitor different from transcoding as sounds? Is the key difference for you whether the transcoding is active or passive on the part of the thinker of the thought?

Put another way, if we define "thought" as being limited to those things which have no perceptible effect on the world at all, then we run into the separate question about whether this "thought" thing exists in the first place.
bzbarsky
·9년 전·discuss
> to communicate their intention to collaborate on the plan

What the law says is "conspire to violate".

If person X and person Y together work out a way for person Y to commit murder and then person Y commits murder, is person X considered as conspiring?

> People don't think in groups

Sure they do. It's called "conversation" or "correspondence". If we had telepathy, we could skip the transcoding to sound or text, but we don't yet, but fundamentally it's the same thing.
bzbarsky
·9년 전·discuss
> ...It's legal to think about murder as long as you don't behave that way.

Sort of. https://www.law.cornell.edu/uscode/text/18/1117 ("conspiracy to commit murder") only requires one person to take action and everyone in the group that did the thinking with them is guilty of a crime. This is in the US, but I would be quite surprised if various other countries did not have similar statutes.

More generally, there are all sorts of laws out there that effectively criminalize thoughtcrime rather than behavior. Of course behavior might be needed for anyone to _discover_ the thoughtcrime.