Most voted "garbage-collector" questions
Garbage Collector (Garbage Collector) is a process used for the automation of memory management. With it it is possible to recover an area of memory unused by a program, which can prevent memory leakage problems resulting in the depletion of free memory for allocation. If the question is not about "Garabage Collector", do not use this tag even if you are using "Garabage Collector" in your project.
Learn more…46 questions
Sort by count of
-
39
votes2
answers1301
viewsHow does the G1 (Garbage First Collector) work?
In the JEP-248 the definition of G1 has been discussed (Garbage First Collector) as the standard Garbage Collector on Java 9. In this period, I have heard many quotes about the G1, but very little…
java performance memory-management jvm garbage-collectorasked 9 years, 4 months ago Reginaldo Soares 2,256 -
23
votes3
answers478
viewsCan Garbage Collector language be used for games?
I started learning C# and even Java for interest in game development. But I know that many are developed with C++, mainly because I don’t have one Garbage Collector. Of course I know that several…
-
21
votes1
answer622
viewsAt what times is it necessary to force garbage collection in C# for better application performance?
Usually I always have doubts about the use of functions for memory release, in which situations should it be used or should it always be used? And mine really will perform better? If possible…
-
21
votes2
answers3969
viewsWhat is Garbage Collector and how does it work?
What is Garbage Collector, how it works? When should we care about him?
-
20
votes2
answers1104
viewsHow is Garbage Collection implemented in Go?
In Golang saw that this language is compiled (and indeed, the website itself tells for which architectures the compilers generate code), and, to my surprise, is Garbage Collected! Garbage Collection…
-
18
votes3
answers1132
viewsWhen to use finalizers and garbage collection in Java?
When to use the methods System.gc() and finalize()? I read that it is very useful in object orientation to destroy memory objects that are not being referenced and to finish tasks, but I see few…
-
17
votes3
answers959
viewsWhy does calling System.gc not guarantee running the Garbage Collector?
Why the developer does not have full control over the Garbage Collector? I understand that the role of GC is to automatically manage the memory but why even using some method like the System.gc…
-
15
votes2
answers160
viewsWhat are "weak references"? When to use them?
In managed memory environments like Java, Python and Javascript, I’ve read something about weak references (WeakRef). I read that it had something to do with detecting the objects that can be…
terminology language-independent reference garbage-collectorasked 6 years, 4 months ago Jefferson Quesado 22,370 -
14
votes1
answer328
viewsHow does the Javascript garbage collector work?
Simple variables Correct me if I’m wrong, but in Java the garbage collector eliminates objects that are no longer referenced: Cliente cliente = new Cliente(); cliente = null; // o coletor de lixo…
-
14
votes2
answers2001
viewsDoes Delphi own a garbage collector?
Does Delphi have an automatic garbage collector? How does it work. If not, what tools can do this?
delphi memory memory-management garbage-collector object-pascalasked 9 years, 8 months ago Giovani 2,875 -
11
votes1
answer255
viewsCanonicalized Mapping and Weakreference
I would like someone to explain the concept (and applications) of Canonicalizing Mapping and how your reference implementation would work using Weakhashmap.…
java performance memory-management hashmap garbage-collectorasked 9 years, 5 months ago Reginaldo Soares 2,256 -
9
votes2
answers1919
viewsWhen should I use GC.Suppressfinalize()?
In . NET, under what circumstances GC.SuppressFinalize()? What are the advantages of using this method? Obs: I found answer in the SO-en: When should I use GC.Suppressfinalize()? As it had nothing…
-
9
votes1
answer191
viewsWhat is Borrow Checker?
I was reading a little bit about Rust and I came across that term, I’d like to know: What is Borrow Checker? Is there any connection with Counting? What would be the translation for this term in…
terminology characteristic-language garbage-collector rustasked 4 years, 8 months ago Denis Rudnei de Souza 3,686 -
8
votes2
answers1716
viewsWhat is the difference between Idisposable implementations?
I confess that I still don’t understand everything about how to manipulate the destruction of an object in the C# and now, as I’m testing Visual Studio 2015 Preview, when implementing a database…
-
8
votes1
answer305
viewsImpact of the Garbage Collector
The project here of the company is done in Windows Forms and we do not manage memory very well, because it is a legacy system that has several years running. Currently we are facing problems with…
-
8
votes1
answer93
viewsDoes Java misjudge memory usage values or is there something wrong with the algorithm?
I was studying GC and the doubt arose when I ran it below: public class Garbage { public static long carregarMemoria() { List<Integer> list = new ArrayList<>(); for (int i = 0; i <…
-
8
votes2
answers213
viewsDo I need to assign null to a variable after use?
There is a need to allocate null in the object after its use? In the example below just after using the list I have a method that takes a lot of time to run. I need to assign null to the list to…
-
8
votes2
answers300
viewsWhy does . NET’s Garbage ollector have several generations?
I understand why there is a Garbage Collector, but I wanted to know the advantages of making it have several generations. It seems something much more complicated, it needs to be very advantageous.…
-
8
votes1
answer127
viewsStatic members are collected by GC when no longer needed?
In a class that has a static variable, it exists throughout the application. The linked object is collected at some point? Example: public class Exemplo { private static List<int> lista = new…
-
7
votes1
answer113
viewsIs there a difference between using discard or ignoring the value returned by a method?
I have a method similar to the below: public bool FazerAlgoERetornarSeSucesso() => true; And at some point, I need to call this method, but I don’t care about the result. Normally I would do…
-
6
votes1
answer1184
viewsGarbage Collector for C++
I clearly understand what a Garbage Collector is and what it is for. It is very well known in Java. Is there a C++ library that implements GC or fixes memory lLeaks? I’ve searched the internet but…
-
6
votes1
answer781
viewsConnection pool with ADO.NET and Sqlconnection Dispose, what is correct to do?
I asked a question yesterday about What is the difference between Idisposable implementations? I was implementing a class to help obtain instances of SqlConnection, SqlCommand, SqlDataReader methods…
-
6
votes1
answer83
viewsIs there any way to be notified that there will be a garbage pickup?
I’m studying about the Garbage Collector do . NET and wanted to know if there are any events that I can sign and be aware whenever a collection will be made.
-
6
votes2
answers720
viewsCan memory leak occur in Java?
In the C language, for example, memory leaks are common because the responsibility for shifting memory lies with the programmer. In the example below (taken from Wikipedia) we can see a classic…
-
6
votes1
answer97
viewsDoes removing a DOM element also remove your listening?
I already know the appeal of Dirt collector. My doubt is in relation to this recourse to the addEventListener. Example test.addEventListener('mouseover', function(){ test.className = 'active'; });…
-
6
votes1
answer219
viewsHow does the . NET "using" and Garbage interface work?
In a reply now deleted here on the site it seems that there was some confusion with the content indicating the use of GC.Collect() and how the using C# works. So how does it actually work using and…
-
5
votes1
answer3064
viewsDifference between null and clear on an Arraylist
What’s the difference between: arrayList.clear(); and arrayList = null; The two do not destroy all elements of Arraylist?
-
3
votes2
answers108
viewsMemory Leak in Xmlserializer
I have the code below. How the method is static and the XmlSerializer does not implement the Dispose, at each call of the method, the system stacks in memory or the GC (Garbage Collector) can clear…
-
3
votes1
answer109
viewsMemory allocation and wiping in C - how much should I worry about?
I’m learning C from the book "Use Your Head! C" (damn me). Given a lesson, I need to create a struct calling for "island" with the following code: typedef struct island { const char *name; const…
-
3
votes2
answers83
viewsObjects eligible for the AG
I have the following certification issue on the Garbage Collector: 1: public class Rabbit { 2: public static void main(String[] args) { 3: Rabbit one = new Rabbit(); 4: Rabbit two = new Rabbit(); 5:…
java objects instantiate-object garbage-collector jvmasked 3 years, 11 months ago Deivson Bezerra 149 -
2
votes1
answer1149
views"Finish" method in Java
How does the "finalize" method work in Java? It is called implicitly? Below is a code with this method that I cannot understand. The class EmployeeTest calls this method, but I don’t know how.…
-
2
votes1
answer146
viewsGarbage Ollector is automatic?
I noticed that my application was deliberately consuming the memory even after the end of the processing, even finishing everything that was started so I called the GC.Collect(); and the memory was…
-
2
votes1
answer166
viewsWhen will the object be eligible for the Garbagecollector?
From the code snippets below, in which the object created in new Pessoa("João") will be available for the Garbage Collector on the line: //outras instruções ? They are all independent codes. They…
-
2
votes1
answer478
viewsStatic properties and memory release
I’m having some doubts regarding the release of resources for cases where my modifiers are static. My project is unit test and I’m using Selenium for the first time. public class LoginTest : Base {…
-
2
votes2
answers172
viewsDoes the garbage collector really exist? Why then is there a memory leak in runtimes that use it?
I’ve heard of memory leakage in Oracle.DataAccess.dll and in large applications developed for runtimes with garbage collector. If the garbage collector exists in those runtimes, why there is memory…
-
2
votes1
answer187
viewsDoes Garbage Collector remove all objects or only those that have no reference?
In a Java application there are objects that are not being used, among these objects there are those that have no reference. Like the Garbage Collector deals with it? He removes all or only those…
-
2
votes2
answers355
viewsAdvantage in giving null in a variable on Android
Assign the value of null in a variable on Android can improve application performance? As far as I know, in Java we have the Garbage Collector, and in Android, the activity cycle of Activities and…
java android null variable-declaration garbage-collectorasked 7 years, 3 months ago Guilherme Ramos 343 -
2
votes3
answers106
viewsHow to create unmanaged variables?
When a variable is created, a value in memory is allocated to it, which can be accessed by any system on the outside from the address of that memory. Creating a file to store the contents of a…
.net security-guard memory-management garbage-collectorasked 6 years, 4 months ago CypherPotato 9,292 -
1
votes1
answer320
viewsimpact of a high heap memory on the JVM
What is the impact of having a high heap memory on the JVM? Does Garbage Ollector take longer to clear the memory when it is too high (around 12gb)? If yes, is there any way to prevent this delay…
-
1
votes1
answer67
viewsHow to create a Weakhashset /Weakset in Java
The java.lang.ref package offers classes that model reference types in Java, such as Reference, Softreferece, Weakreference and Phantomreference. Still not familiar with these references in Java?…
-
1
votes0
answers39
viewsWhen is it necessary to use GC.Collect()?
I know that in . NET/CLR, the Garbage Collector acts alone, without it being necessary to call him manually. There are cases where the Garbage Collector does not "collect" automatically? When it is…
-
0
votes1
answer84
viewsThe bug with Garbage Collection (garbage collector) was fixed in which version of PHP?
Error: PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php/Session) failed: Permission denied (13)…
-
0
votes1
answer115
viewsHow do I know if there is a CRON working on the PHP 5.3 (Centos) garbage collector?
I have this mistake: ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied. The normal correction is to define session.gc_probability = 0 But in Centos, the correct thing is that…
-
0
votes0
answers47
viewsGarbage Collector from Visualvm
I have a Java web application running Spring on Tomcat 7.0. As the days go by, the use of memory goes up slowly and does not go down much, although by the Visualvm I realize that the GC runs…
-
0
votes1
answer57
viewsHow to set to default value all PHP settings?
I have a Linux Centos VPS and the garbage collector configuration is wrong. I need to fix it in an easy way since I have very little knowledge of it. I wonder if there’s a way to set all the PHP…
-
0
votes1
answer51
viewsHow to get the amount of garbage already generated at a time from Java code?
So people, I’d like to know if you have any method or even way to get the amount of Garbage generated at the current moment of the code. If you do not know but if you know any DOC that I can study…