| ▲ | andsoitis an hour ago | |
> Allocate all necessary memory during startup and avoid dynamic memory allocation after initialization. Why? | ||
| ▲ | Manfred an hour ago | parent | next [-] | |
I think they are hinting at the idea that a long running process on a dedicated server should allocate all necessary memory during initialization. That way you never accidentally run out of memory during high loads, a time when you really don't want your service to go down. You would need so much more physical memory with this approach. For example, you may want to allocate a lot of memory for the browser, but then close the tab. 2 seconds later you want to use it for a compiler. And then you switch to a code editor. | ||
| ▲ | Cwizard an hour ago | parent | prev [-] | |
You can run out of memory and trigger a crash. | ||