Questions tagged [garbage-collection]
Garbage collection (GC) is a form of automatic memory management which attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program.
garbage-collection
12,163
questions
1
vote
1
answer
10
views
change GC in quarkus jib build docker container
How can the default GC be changed in quarkus docker image using jib as building engine?
I have tried with settings in application.yaml but got duplicate gc defined error as using the following ...
0
votes
0
answers
8
views
What is 'MarkDependentCodeForDeoptimization()' used for in V8's Mark-Compact phase?
After Debugging in the V8 source code, I really cannot figure out what is the MarkDependentCodeForDeoptimization(); which is called in function MarkCompactCollector::ClearNonLiveReferences() used for?
...
0
votes
1
answer
22
views
Is my closure in an expressjs middlware causing a memory leak?
I have a middleware function that sets some utility clients on the request object. When the response finishes it destroys the connections.
export const setRequestUtils = (req: Request, res: Response, ...
0
votes
0
answers
9
views
Comment optimiser l'utilisation des resources mémoires (RAM) sur flutter?
Comment optimiser l'utilisation de la mémoire dans une application Flutter en contrôlant le Garbage Collection (GC) pour éviter les fuites de mémoire et améliorer les performances?
J'ai essayé ...
0
votes
0
answers
9
views
The way Elasticsearch deals with control heap memory when indexing documents
I have a question about objects genereated when the document is indexed.
All objects based on jvm are stored in heap and will be reclaimed by GC unless they are still referenced by other objects or ...
-1
votes
0
answers
64
views
How can I detect a variable going out of scope, and do something. C [closed]
I was looking at the cello library, specifically the garbage-collection and was interested in doing something similar, but I could not find any way on how to detect that a variable has gone out of ...
-1
votes
0
answers
12
views
Is it possible for a .net core app run 2 different GC modes at the same time?
I have .net 7 WPF app which uses server GC. It has bunch of nugets from 3rd parties. When I run dotTrace I see threads that are server GC AND background GC.. How is it possible?
-4
votes
0
answers
54
views
Does "new" create String object in SCP and how GC work in JDK6 and newer versions on String constant pool? [closed]
I have found multiple questions, articles and videos regarding this question, all having different answers, so I am compelled to make this question and appreciate anyone who helps especially quoting ...
-1
votes
2
answers
85
views
Why do we need the finalizer in the disposable pattern if it is not guaranteed that it will be called by the garbage collector? [duplicate]
My question is: in C#, why do we need the finalizer in the disposable pattern if it is not guaranteed that it will be called by the garbage collector?
I have problems understanding the philosophy ...
1
vote
2
answers
73
views
Out of memory in clojure - Nested reduce on Lazy Sequence
Something as simple as adding 3 nested reduce is giving me an out of memory error.
Execution error (OutOfMemoryError) at .../my-large-lazy$iter$fn$fn$iter$fn$fn$iter$fn$fn (serial_write.clj:39).
Java ...
0
votes
1
answer
45
views
Why does process memory grow in .Net, but managed heap size does not change?
I am experiencing a weird memory leak in C#, which does not make any sense to me. Here is a simple example that recreates this problem.
I have a simple class that can hold an array of bytes:
public ...
1
vote
1
answer
35
views
What is wrong with this Reflection.Emit for value conversion delegates?
Sorry for this long question but I feel I have to provide a bit more background as my issue is very specific.
Bigger picture
I am developing on a Unity tool to be used specifically for Embedded Linux ...
0
votes
1
answer
34
views
Python, How to stop tkinter variables from being garbage-collected?
I have a function that creates a tkinter window with many checkbutton widgets on it. Later, a button on another window saves the states of these checkbuttons. The function that does this is passed the ...
0
votes
0
answers
31
views
C# X509Certificate2 private key disappear when GC occurs
I am experiencing a really weird encryption certificate problem. I install a .p12 file with 1 encryption cert into StoreName.MY, everything seems to work fine, I open the Certificate Manager and could ...
0
votes
0
answers
19
views
Query about initialization of objects created within a static method by the garbage collector
I have a question regarding the behavior of the garbage collector in C#.
I tried writing a simple code and testing it, but it returned null. I'm not sure about the details.
public static void Test()
{
...
0
votes
1
answer
53
views
Garbage collection and Memory leak in Java
I have read that in Java, GC (Garbage Collection) will clean up objects that are not referenced in the Heap memory.
I am not sure how to test or not sure if, after line 3, the variables person, room (...
1
vote
1
answer
36
views
Exclude JS object from GC marking
I have a an object {} which holds a lot of sub-objects, it's basically like a large embedded key-value store of objects. They need to be in-memory for performance reasons (access latency to them is ...
0
votes
1
answer
48
views
Memory usage of single function in Node.js
We are doing an experiment where we need to obtain the memory usage of a set of functions. Our initial approcah was to use the process.memoryUsage().heapUsed before and after the function call, and ...
-1
votes
1
answer
48
views
Java Garbage Cleaner detector [closed]
How to detect java garbage cleaner?
It can be useful, when you want to do some experements on java or learn how java works.
4
votes
1
answer
131
views
What is the most efficient way to create a temporary collection? Differences between stackalloc, and collection expressions?
In C# there are now multiple ways to create a temporary collection.
You can just new an array and hope the garbage collector doesn't mind.
// Just create a new array
Span<int> array = new int[]{ ...
0
votes
0
answers
68
views
Error: The process was terminated due to an internal error in the .NET Runtime at IP 733270F0 (731A0000) with exit code 80131506
A Windows mixed-mode application terminates with a message box:
(Exception Processing Message 0xc0000005 - Unexpected parameters)
enter image description here
There is an entry in the event log:
...
0
votes
1
answer
56
views
Deadlock in Python garbage collection on exception
I have encountered a strange situation where a program won't exit due to the way python handles exceptions. In this situation, I have an object which owns a Thread, and this Thread is only shut down ...
0
votes
0
answers
23
views
python memory leak in linked list with UIDs
I am creating a linked list such that removing of items is not taking O(n^2) as discussed in: https://www.reddit.com/r/learnpython/comments/p98v56/i_was_surprised_at_how_slow_listpop_is_and/
I created ...
1
vote
2
answers
29
views
Why isn't my custom element being garbage-collected?
Consider a webpage that contains a button which triggers the opening of a modal:
<dialog></dialog>
<button>Open modal</button>
const trigger = document.querySelector(`button`)...
0
votes
0
answers
37
views
Getting a pointer to a value type on the heap that updates when gc moves the value
Let's imagine we have an instance of a value type already in the managed heap(as part of a class or an Array). We can then get a Memory instance that references some element of the array.
Memory<...
1
vote
0
answers
51
views
Memory leak : ObjectListView TreeListView cache is keeping a reference alive, how to disable?
This is happening with the NuGet package ObjectListView.Official 2.9.1, with .NET Framework 4.7.2.
I can't figure out how to dispose of the objects that are loaded inside a TreeListView, even after ...
0
votes
1
answer
50
views
How is a garbage collector included in the final product of a compiler?
The question would mainly about how a garbage collector is included in programs written in a programming language. Let's for example take a language that uses LLVM, would the developers just write a ...
0
votes
1
answer
29
views
Button is not destroyed when class is deinstantiated
I'm using P5.js to create two scenes
A global variable currentScene instantiates the Scene to be rendered.
Then I have two scene classes:
A MainMenuScene, with a button New Game that instantiates ...
0
votes
0
answers
23
views
How to statistics G1 mixed gc count
I use jstat -gc command to view gc count,But I don't know which indicator represents mixed gc count.
jdk verson is 17.0.9,garbage collector is G1.
jstat -gc -t 3571192 1000 1000
Timestamp ...
0
votes
2
answers
25
views
IronPython garbage collection - How does it provides compatibility with C-extensions?
In this part of the talk on GIL by Larry Hastings, there is an explanation about how ironclad provides C-extension compatibility with IronPython. This is the interesting part of the talk:
We ...
0
votes
0
answers
102
views
Understanding and Optimizing Generational Garbage Collection in Haskell
When a program initializes, the mutator allocates memory space for new small objects in the nursery. The nursery serves as a buffer to maintain recently created objects. If these objects remain alive ...
0
votes
1
answer
65
views
Appropriate use of `void **` for garbage-collected structs in C?
I need some help with void ** pointers.
In implementing a garbage collector in C (automatic reference counting), I've found I need a special assignment operator (similar to what C++ does with std::...
0
votes
0
answers
38
views
GC cleans Tenured Gen heap quite rarely
According to New Relic reports, Tenured Gen heap is cleaned pretty rarely, and from time to time application used heap reaches ~80% of max heap, but I want it to reach ~70% and get cleaned. How to ...
1
vote
0
answers
41
views
jmap -dump is FULL GC be executed?
I'm trying to create and analyze a heap dump using Java Jmap.
I learned how to do and concept through Google.
jmap -dump:format=b,file=heapdump.hprof[pid]
If the command at the top is executed, does ...
0
votes
1
answer
53
views
Understanding JavaScript Garbage Collection behavior in memory intensive tasks
I am currently investigating memory usage patterns related to JavaScript's garbage collection in an application I am developing. I have constructed a simple benchmark to better understand GC's ...
0
votes
1
answer
130
views
Long garbage collection time
Long garbage collection time experienced by our client in our java web-app (JAVA 8, Tomcat 9) and eventually the application gets suspended indefinitely. Dynatrace performance management tool log ...
0
votes
1
answer
37
views
Does python garbage collector collects objects with cyclic allocations like below?
Will variable "a" be garbage collected by python garbage collector?
a = [1,2,3]
b = [a,a]
a.append(b)
If yes, then what happens if we change value of a dynamically? And how does "b&...
0
votes
1
answer
52
views
Why do we need Thread.sleep after calling System.gc in JDK native memory usage scenario?
After my research on the source code implementation details of System.gc in Java17 ,i found that System.gcwill eventually trigger two gc types:
full gc (stop the world), when we use SerialGC, ...
2
votes
1
answer
116
views
Why Go GC have some long pauses STW (a few millisecond) in this program?
In one of our services it was found that gc would occasionally have some long STW (up to 100ms), I wrote a random program and found that it did indeed do this and why. This program sometimes thousands ...
0
votes
0
answers
26
views
System.Servicemodel exception or StackOverflow exception while calling R code from C#
Tried Garbage collection and all kind of suggestions by R.net but no use.
I am getting System.Servicemodel exception or StackOverflow exception while trying to evaluate R code from C# using R.Net. ...
0
votes
1
answer
39
views
Will a parent object that is no longer referenced be reclaimed through GC if the parent object itself holds a live reference?
Will a parent object that is no longer referenced be ineligible for collection if it holds a reference to an object that is still alive, like a singleton service that is referenced in other viewmodels?...
5
votes
0
answers
203
views
Does the 'unmanaged' Constraint in C# Relate to Unmanaged Resources and the Garbage Collector?
I've been studying the unmanaged constraint in C#, and it raised a question in my mind: Is the unmanaged constraint related to the management of 'unmanaged resources' and the garbage collector?
...
1
vote
0
answers
221
views
Upgrading from jdk17 to jdk21 caused increased cpu usage during GC
I have spring boot apps running on k8s.
After upgrading a app from jdk17 og jdk21 in production, we see a increased cpu usage during GC causing pod scalling.
The initial k8s request.limit was set to ...
0
votes
0
answers
57
views
(Spring Boot 2.7.18) After running the application, something filling in the Eden Space
You can see the executed application code in https://github.com/JadeKim042386/AccountService.
[Environment]
Mac M1
JDK 17 / G1 GC
[VM Options]
-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun....
0
votes
1
answer
48
views
Garbage Collection of value types inside an array
Suppose I have some small data type - for example a simple point implementation. I can either implement this type as a reference type (class), or as a value type (struct).
public class PointClass
{
...
0
votes
0
answers
62
views
Excessive memory usage
I have a ASP.NET Core 6 application which from time to time consumes a WCF service. The basic implementation looks like this:
builder.Services.AddSingleton<StorageCostDataService>();
builder....
0
votes
1
answer
48
views
Angular - Remove object from memory without destroy component
I have an quite complex angular app and it causes the browser to crash very quickly. So I am looking to optimize it. I fix every subscription memory leak but the problem is still here. So I use Chrome ...
0
votes
1
answer
68
views
Unable to identify the Limit of Young Generation Space in V8
I am researching about --max-semi-space-size in NodeJS and have gone through articles online. However, I found the following text from a 6 years old blog from v8
Since the young generation is ...
0
votes
0
answers
40
views
Android Fatal signal 11 (SIGSEGV), code 1 after GC freed
I'm getting randomly application crashes in android, looking at my logcat the only thing in common that I can see is that the garbage collector was called just before.
The app is developped in Kotlin ...
1
vote
0
answers
19
views
Garbage collection seems to be quite flaky in .NET 6.0
I have a TCP connections server written in .NET 6.0. Clients establish TCP connections with the server using SslStream, send and receive data, then disconnect.
While hundreds of connections are being ...