3 ms·
On the other hand memory management in web applications is quite easy. Most of the stuff is only required for the lifetime of a request. Some stuff needs to be
by SvenL 2y ago
On the other hand memory management in web applications is quite easy.
Most of the stuff is only required for the lifetime of a request. Some stuff needs to be available the whole application life time.
- smt88 2y agoYou can do this with other languages (C# for example) as well. Memory is so cheap, though, that most companies should spend their money on increasing memory rather than on paying programmers to optimize memory usage.
- HexDecOctBin 2y agoCheap for whom? American programmers with FAANG salaries, or an under-funded third world NGO?
- kaba0 2y agoBoth. My phone could easily serve thousands of concurrent users.
- SvenL 2y agoYes, for most use cases it doesn’t really matter which language is chosen. Regarding just spending more money on memory - I agree that it’s definitely cheaper but it’s not only about wasting bytes of memory. If the garbage collector has a lot of work to do it may also impact response time/throughput. And yes, C# did a pretty good job with implementing mechanisms for reducing allocations on a language level. This definitely helps to reduce garbage collection.
- marginalia_nu 2y agoI don't think memory usage is the problem, but rather allocation costs and memory layout, i.e. performance. Serving web traffic simply isn't a very memory hungry task.