Questions tagged as 'garbage-collector'

2
answers

How does the G1 (Garbage First Collector) work?

In the JEP-248 discussion of the G1 definition ( Garbage First Collector as the default Garbage Collector on Java 9 . In this period, I've been hearing a lot of G1 quotes, but very little material has deeper details or comparisons, for examp...
asked by 25.07.2015 / 05:00
2
answers

How is Garbage Collection implemented in Go?

In Golang I saw that this language is compiled (and that's right, the website itself tells which architectures compilers generate code for), and, to my surprise, it's Garbage Collected! Garbage Collection is virtually universal in the world...
asked by 19.04.2014 / 01:42
1
answer

How does the JavaScript garbage collector work?

Simple variables Correct me if I'm wrong, but in Java the garbage collector deletes objects that are no longer referenced: Cliente cliente = new Cliente(); cliente = null; // o coletor de lixo cuidará disso The same goes for JavaScript?...
asked by 18.09.2014 / 13:36
3
answers

Why calling System.gc does not guarantee execution of the garbage collector?

Why does not the developer have full control over the garbage collector ? I understand that the role of GC is to automatically manage memory but why even using some method like System.gc is there no guarantee that the GC will run?   ...
asked by 22.12.2015 / 05:23
2
answers

What are "weak references"? When to use them?

In managed memory environments such as Java, Python, and JavaScript, I've read something about weak references (% with%). I read that it had something to do with detecting the objects that can be collected, but it was not clear. My question...
asked by 14.07.2018 / 04:03
2
answers

Do I need to assign null to a variable after use?

Is there a need to assign null to the object after its use? In the example below right after using the list I have a method that takes a long time to run. Do I need to assign null to the list to optimize the application? priva...
asked by 20.01.2017 / 17:35
2
answers

What is the difference between implementations of IDisposable?

I confess that I still do not understand everything about manipulating the destruction of an object in C # and now, when testing Visual Studio 2015 Preview , when implementing a class I have included the inheritance of IDisposable and...
asked by 24.06.2015 / 03:00
1
answer

Are static members collected by GC when they are no longer needed?

In a class that has a static variable, it exists throughout the application. Is the linked object collected at some point? Example: public class Exemplo { private static List<int> lista = new List<int>(); }     
asked by 10.05.2017 / 16:16
1
answer

Does Java accuse wrong memory usage values or is there something wrong with the algorithm?

I was studying GC and the question came up when I rode the below: public class Garbage { public static long carregarMemoria() { List<Integer> list = new ArrayList<>(); for (int i = 0; i < 100000; i++)...
asked by 19.10.2016 / 15:52
2
answers

When should I use GC.SuppressFinalize ()?

In .NET, under what circumstances should GC.SuppressFinalize() be used? What are the advantages of using this method? Note: I found the answer in the SO-en: When should I use GC.SuppressFinalize ()? As I did not have something r...
asked by 08.12.2015 / 14:35