www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Rebrand GC as "automatic memory leak detection and cleanup"

reply James Lu <jamtlu gmail.com> writes:
As noted in another thread:

 * The garbage collector eliminates probably 60% of potential 
 users right off.
If we rename garbage collection to "automatic memory leak detection and cleanup." For people who write realtime applications, that's what it is. D is garbage collected in the sense that it's available as an option. Walter noted that with 20+ years of experience writing manually managed code, he still could not write leak-free programs. I propose: * Rename GC to automatic memory leak detection and cleanup in documentation * Make core.memory.__delete a better name. Perhaps core.memory.free. * Runtime should have an option to emit a warning every time an object is cleaned up on the major heap. There should be a compiler or runtime option that attaches debug information so we stack trace of the allocation. Optionally, this could be enabled for certain classes via a UDA. * If possible, a compiler and/or runtime option to safely detect and warn on double-frees. That way, we can boast being memory-safe. As someone who writes a realtime, major-GC-is-not-allowed JavaScript game, having the stack trace of where an object is leaked helps fixing garbage generation greatly.
Apr 12 2021
next sibling parent James Lu <jamtlu gmail.com> writes:
On Monday, 12 April 2021 at 22:47:29 UTC, James Lu wrote:
 If we rename garbage collection to "automatic memory leak 
 detection and cleanup." For people who write realtime 
 applications, that's what it is. D is garbage collected in the 
 sense that it's available as an option.
Static pages and AJAX made a comeback with JAMStack (JavaScript, APIs, and Markup), "The modern way to build Websites and Apps that delivers better performance." You could imagine something similar. "It keeps programs that do have leaks correct, all the while having zero overhead for programs without leaks."
Apr 12 2021
prev sibling next sibling parent reply Paulo Pinto <pjmlp progtools.org> writes:
On Monday, 12 April 2021 at 22:47:29 UTC, James Lu wrote:
 As noted in another thread:

 * The garbage collector eliminates probably 60% of potential 
 users right off.
If we rename garbage collection to "automatic memory leak detection and cleanup." For people who write realtime applications, that's what it is. D is garbage collected in the sense that it's available as an option. Walter noted that with 20+ years of experience writing manually managed code, he still could not write leak-free programs. I propose: * Rename GC to automatic memory leak detection and cleanup in documentation * Make core.memory.__delete a better name. Perhaps core.memory.free. * Runtime should have an option to emit a warning every time an object is cleaned up on the major heap. There should be a compiler or runtime option that attaches debug information so we stack trace of the allocation. Optionally, this could be enabled for certain classes via a UDA. * If possible, a compiler and/or runtime option to safely detect and warn on double-frees. That way, we can boast being memory-safe. As someone who writes a realtime, major-GC-is-not-allowed JavaScript game, having the stack trace of where an object is leaked helps fixing garbage generation greatly.
People that care about safety and real time GC don't need renaming to be convinced, https://www.ptc.com/en/products/developer-tools/perc https://www.ghs.com/partners/aicas_partner.html Here is one example of how much real time it actually is, https://www.ptc.com/en/blogs/plm/ptc-perc-virtual-machine-technology-at-the-of-aegis-the-shield-of-the-fleet
 Lockheed Martin reviewed various options for the Aegis Open 
 Architecture including the programming language and execution 
 environment for the system.  In their experiments, they found 
 that HotSpot Java code ran comparable to C++ on an experimental 
 250 millisecond periodic workload.  At the same time, they 
 found that the Java language provided superior abstraction and 
 encapsulation than C++, and they judged that retraining their 
 existing staff of CMS-2 programmers to become effective in Java 
 would have lower risks than attempting to train them in C++.
 .....
 Using Java and PTC Perc Ultra, Lockheed found that newly 
 trained Aegis software engineers implemented a core component, 
 the Aegis Air Defense Warfare (ADW) software, consisting of 
 150,000 source lines of code, in only 18 months, including test 
 and evaluation and full requirements verification.  The first 
 deployment based on the new Aegis Open Architecture required 
 only three years from hardware selection to on-ship hardware 
 refresh, compared to seven years or longer previously.
 ....
 After completing the Aegis Open Architecture refresh, support 
 was added for the new “Standard Missile 6” with only 3 
 additional months of development effort.  Based on experiences 
 with the legacy Aegis implementation, Lockheed would have 
 expected a minimum of a full year of additional development to 
 add support for a new missile.
 Obviously a notable success, Aegis, powered by PTC Perc is now 
 deployed on numerous U.S. ships and those of allied nations.  
 The program has also been expanded beyond shipboard deployment 
 to land-based installations called Aegis Ashore.
Naturally that won't change the mind of the anti-GC folks.
Apr 13 2021
parent reply James Lu <jamtlu gmail.com> writes:
On Tuesday, 13 April 2021 at 11:41:05 UTC, Paulo Pinto wrote:
 Lockheed Martin reviewed various options for the Aegis Open 
 Architecture including the programming language and execution 
 environment for the system.  In their experiments, they found 
 that HotSpot Java code ran comparable to C++ on an 
 experimental 250 millisecond periodic workload.
Every 250ms isn't what I'd call "realtime." My application must run every 16ms. There were 4 major heap garbage generation points. This made the application extremely annoying to use and was a dealbreaker.
 People that care about safety and real time GC don't need 
 renaming to be convinced,

 Naturally that won't change the mind of the anti-GC folks.
This isn't for people who "care about safety and realtime GC." This is for anti-GC folks. If we don't call it "GC", they won't hate it. People aren't rational.
Apr 13 2021
next sibling parent reply James Lu <jamtlu gmail.com> writes:
On Tuesday, 13 April 2021 at 11:41:05 UTC, Paulo Pinto wrote:
 Lockheed Martin reviewed various options for the Aegis Open 
 Architecture including the programming language and execution 
 environment for the system.  In their experiments, they found 
 that HotSpot Java code ran comparable to C++ on an
 experimental 250 millisecond periodic workload.
Your article seems to speak of people actually using the GC so they can speed up development. My game, written in JavaScript, a garbage-collected language, uses pooling. Pooling is the equivalent to manual deallocation. Without pooling the freezes are unbearable. From the performance envelope of my game, a GC gives the strength of an emergency cleanup system and leak detector. The idea is to emphasize the GC can be completely disabled.
Apr 13 2021
parent reply Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Tuesday, 13 April 2021 at 14:23:22 UTC, James Lu wrote:
 On Tuesday, 13 April 2021 at 11:41:05 UTC, Paulo Pinto wrote:
 Lockheed Martin reviewed various options for the Aegis Open 
 Architecture including the programming language and execution 
 environment for the system.  In their experiments, they found 
 that HotSpot Java code ran comparable to C++ on an
 [...]
Your article seems to speak of people actually using the GC so they can speed up development. My game, written in JavaScript, a garbage-collected language, uses pooling. Pooling is the equivalent to manual deallocation. Without pooling the freezes are unbearable. From the performance envelope of my game, a GC gives the strength of an emergency cleanup system and leak detector. The idea is to emphasize the GC can be completely disabled.
Imo we should try make the D GC generational instead.
Apr 13 2021
parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Tue, Apr 13, 2021 at 06:22:47PM +0000, Imperatorn via Digitalmars-d wrote:
[...]
 Imo we should try make the D GC generational instead.
That requires write barriers, which Walter has been very resistant to. T -- English is useful because it is a mess. Since English is a mess, it maps well onto the problem space, which is also a mess, which we call reality. Similarly, Perl was designed to be a mess, though in the nicest of all possible ways. -- Larry Wall
Apr 13 2021
parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
On Tuesday, 13 April 2021 at 18:30:19 UTC, H. S. Teoh wrote:
 On Tue, Apr 13, 2021 at 06:22:47PM +0000, Imperatorn via 
 Digitalmars-d wrote: [...]
 Imo we should try make the D GC generational instead.
That requires write barriers, which Walter has been very resistant to. T
Yeah, I understand that..
Apr 14 2021
prev sibling parent Luhrel <lucien.perregaux gmail.com> writes:
On Tuesday, 13 April 2021 at 14:18:27 UTC, James Lu wrote:
 On Tuesday, 13 April 2021 at 11:41:05 UTC, Paulo Pinto wrote:
 Lockheed Martin reviewed various options for the Aegis Open 
 Architecture including the programming language and execution 
 environment for the system.  In their experiments, they found 
 that HotSpot Java code ran comparable to C++ on an 
 experimental 250 millisecond periodic workload.
Every 250ms isn't what I'd call "realtime."
Let's implement a ZGC then. http://cr.openjdk.java.net/~pliden/slides/ZGC-Jfokus-2018.pdf
Apr 13 2021
prev sibling parent Paul Backus <snarwin gmail.com> writes:
On Monday, 12 April 2021 at 22:47:29 UTC, James Lu wrote:
 As noted in another thread:

 * The garbage collector eliminates probably 60% of potential 
 users right off.
If we rename garbage collection to "automatic memory leak detection and cleanup." For people who write realtime applications, that's what it is. D is garbage collected in the sense that it's available as an option.
If you want to see a great example of this, check out Herb Sutter's talk "Leak Freedom in C++...By Default": https://www.youtube.com/watch?v=JfmTagWcqoE
Apr 13 2021