3 ms·
change the default (veeery low) garbage collector settings to use more memory before collection is triggered I'm not familiar with Prolog GC but in other syste
by userbinator 11y ago
change the default (veeery low) garbage collector settings to use more memory before collection is triggered
I'm not familiar with Prolog GC but in other systems, making GC less frequent just tends to cause each collection to take even longer, as more objects have been created between each pass.
- tom_mellior 11y agoThat is true as a general trend, but in my experience with SWI-Prolog the effect is not linear, and frequent small collections do cost more (in MY applications). For one thing, if you have long-lived data used throughout the program's whole lifetime, they will be visited on every collection without ever being freed. For another thing, if you have enough memory to fit all the data ever allocated by the program, you may not need to collect at all! Also, as mentioned in my previous comment, depending on the application there may be program parts where it is OK to trigger even a long-ish collection manually, while you want other parts to be fast and collection-free. So, to reiterate: You are right in broad terms, but it all depends very much on the details of the application.