3 ms·
If your program is short running, then it may be more efficient to disable GC and let the dying process to take care of it all.
by jeeyoungk 3y ago
If your program is short running, then it may be more efficient to disable GC and let the dying process to take care of it all.
- 0cf8612b2e1e 3y agoThere many tales about programs foregoing any kind of memory collection and relying upon the business process itself to resolve the issue. My favorite is a missile. Evidently the program leaks memory like crazy. Solution was to determine how much memory would be required for the platform to fly to its farthest possible target + some margin. Alternatively are stock trading platforms written in Java. Disable the GC entirely because trading hours are only a a limited portion of the day. Restart the program daily.
- hbn 3y agoI like to think the stock market thing is actually the reverse, and they shut it down every night because all the programs that keep it running were written in a memory-leaking tech stack that needs restarting
- titzer 3y ago> My favorite is a missile. This might be apocryphal, as software for this class of embedded system almost certainly doesn't dynamically allocate anything; probably doesn't even use pools. I have a friend who works on missile software at a big defense contractor, and they do actually clean up their memory.
- 0cf8612b2e1e 3y agoI found a source, quoting the quote, so provenance is what it is > This sparked an interesting memory for me. I was once working with a customer who was producing on-board software for a missile. In my analysis of the code, I pointed out that they had a number of problems with storage leaks. Imagine my surprise when the customers chief software engineer said "Of course it leaks". He went on to point out that they had calculated the amount of memory the application would leak in the total possible flight time for the missile and then doubled that number. They added this much additional memory to the hardware to "support" the leaks. Since the missile will explode when it hits its target or at the end of its flight, the ultimate in garbage collection is performed without programmer intervention. [0] https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98125 https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98...
- ilyt 3y agoNobody said it was good missile.