Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> It's commonplace to have 4-10GB of free memory at any given time and it should be utilised if it's available instead of being wasted by being unused.

I'm not sure when this became the new normal, but I was taught the exact opposite. How about trying to squeeze that into 200 MB rather than allocating 4-10 GB just because it happens to be available at that moment?



For some purposes, you can't "squeeze that into 200 MB", especially for caching. If you have memory that's lying around empty, what is the point of having it at all if it's wasted 99% of the time? Is it a virtue in itself to under-utilize resources you have available?

Is it good if a company employs a 100 people but only 15 of them do work and the rest is idle?


First of all, yes you can, even easily - provided that you use a different GUI toolkit. 200 MB is a huge amount of memory anyway, in many cases you can do much better. Electron fans like to talk about caching, but really, that's a browser issue, it has nothing to do with GUIs, at least not with traditional ones. Why should you need to cache any GUI elements if you can (re)create a thousand dialogs in a blink of an eye? Maybe you can cache the _data_ in those windows, but that's a completely different thing, and the memory used is usually some orders of magnitude lower.

Now, as for using all available memory: that's exactly the reasoning that causes so much problems for users, and that's why after so many years of hardware upgrades our machines still feel sluggish: using all resources for your app, only because they happen to be free at that moment, is not OK.

First of all, they are free now, but they might not be a moment later (because another brilliant app author has the same idea and tries to allocate everything). Second, the resources should be used in a reasonable way. If a piece software doing extremely simple computation is suddenly allocating a few gigs of RAM and takes over all cores, my thought isn't "Oh, what an efficient app, it's using all these resources I don't need", but I wonder what went wrong! What is perfectly OK for, say, a 3D rendering node, is completely wrong for an app that could do the same thing with 10x lower resource usage.

I'm not sure if I am able to explain it in more clear terms.


So you're saying increased resource usage is ok for node, but did you know that node is exactly what electron is running on? 200 MB of memory is nothing for a GUI app - and most Electron apps don't even take 100. They need that memory for all these amazing features the framework offers, like running javascript, processing css stylesheets, async execution, etc.


No, by "3D rendering node" I don't mean Node.js but a node (like in a cluster) of a 3D rendering engine.


> For some purposes, you can't "squeeze that into 200 MB", especially for caching

The thing is native apps can do that, and more in less memory. The baseline here is set by "how much is needed", not "how much memory is available".

>Is it good if a company employs a 100 people but only 15 of them do work and the rest is idle?

Yes, if 15 can do the job. then rest can moved for other profitable purposes, or laid off.


You hired those 100 employees for a reason: future growth. If you decide to employ them as subsistence farmers you're not only lacking employees in the future you're also bleeding money left and right.




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

Search: