Questions tagged [garbage-collection]
The garbage-collection tag has no usage guidance.
22
questions
1
vote
0
answers
25
views
A formula of the major garbage collection threshold
I'm studying the garbage collection code of Alex Aiken's COOL programming language's runtime system.
(This is the language used in a relatively famous Stanford Online Compilers course)
A major garbage ...
0
votes
5
answers
1k
views
Could a compiler automatically insert memory deallocations if it were to simulate every conditional statement?
I have read this question on compile time gc and what I understand from it is that the compiler wouldn't know if a variable is referenced or not by some other object due to conditional statements (...
0
votes
0
answers
72
views
Concurrent Garbage-Collectiong/Compacting Memory Allocator
I'm developing an algorithm for concurrent heap garbage collection/compaction. It will be used in low latency systems that need to scale well to a lot of clients, e.g. web servers.
I thought about an ...
2
votes
1
answer
118
views
delete node from linked list (lang w/GC) -should deleted item 'next' be set to null
Regarding: delete a node from a linked list algorithm,in procedural languages with garbage-collection.
Should there be a step in the algorithm, of setting the removed-node-next-pointer to null ?
(...
2
votes
0
answers
37
views
Region-based memory management for recursive type
In the chapter 4 of Pierce's TAPL which discusses the implementation of untyped arithmetic expressions, the author said
The most important [for the implementation requirements] are automatic ...
0
votes
0
answers
22
views
Distribution of number of references to other object in an object
I been thinking about an improvement to a garbage collector (details not important for this question) and wished to know how often does a object have no reference to other objects. Clearly this will ...
2
votes
0
answers
35
views
Sweeping integrated into memory allocation: Why only fixed size objects?
In our language design book, it is mentioned that GC sweep can be integrated into allocation, such that when you call malloc for example, you sweep until you find a ...
3
votes
2
answers
804
views
Is it possible to implement a WeakMap with primitive keys and weak values?
Theory
Basically, I have a use-case where I would like to use primitives to store weak references to non-primitive values. If the value is no longer referenced anywhere else, then the entry should be ...
8
votes
2
answers
338
views
What would a language look like in which precise GC was implementable as a library?
Suppose you have some programming language with manual memory management. What features does this language need to have in order to be able to implement precise garbage collection as a library, and ...
66
votes
12
answers
13k
views
Why don't compilers automatically insert deallocations?
In languages like C, the programmer is expected to insert calls to free. Why doesn't the compiler do this automatically? Humans do it in a reasonable amount of time(ignoring bugs), so it is not ...
5
votes
1
answer
202
views
What are some possible "functional" memory structures?
With my thin knowledge on embedded systems, compilers, and computer architectures, I know that the basics of computer memory(physical) are sort of like an array, with addressing which work like ...
16
votes
6
answers
2k
views
Why does garbage collection extend only to memory and not other resource types?
It seems like people got tired of manual memory management, so they invented garbage collection, and life was reasonably good. But what about every other resource types? File descriptors, sockets, ...
9
votes
3
answers
540
views
Is reference counting GC vs. tracing GC a language property or an implementation property?
We sometimes hear "Swift doesn't do classic (tracing) GC, it uses ARC."
But I'm not sure if there is anything in the Swift semantics that requires reference counting. It seems that one could build ...
4
votes
1
answer
117
views
How did MacLisp's garbage collector "run in the register set"?
Olin Shivers, ‘History of T’:
Maclisp on the [PDP]-10 had used a mark&sweep GC (one version of which famously "ran in the register set," though that is another story)
This implies, in my ...
2
votes
0
answers
82
views
How does the Spark M7 “Concurrent Fine-grain Memory Migration” benefit a garbage collector?
Sun has been making a lot of noise about the Spark M7 and its inbuilt support for the java garbage collector. However there seem to be very little easy to find information about it. Please can ...
24
votes
4
answers
5k
views
How do garbage collectors avoid stack overflow?
So I was thinking about how garbage collectors work and I thought of an interesting issue. Presumably garbage collectors have to traverse all structures in the same way. They can't know weather they ...
3
votes
1
answer
126
views
When was the terminology *tracing collector* introduced to denote both mark-and-sweep and copy collectors
Automatic storage reclamation, aka garbage collection, comes in two
main families, sometimes cooperating: the reference count collectors
and the tracing collectors. I may develop specifics of each ...
32
votes
8
answers
6k
views
Why is the object destructor paradigm in garbage collected languages pervasively absent?
Looking for insight into decisions around garbage collected language design. Perhaps a language expert could enlighten me? I come from a C++ background, so this area is baffling to me.
It seems ...
5
votes
1
answer
238
views
Recent Garbage collection survey paper
Many years ago I read a GC survey paper that was updated every few years with advances; I tried to find such a paper today to point a questioner on Stackoverflow at.
However all I can find is very ...
7
votes
1
answer
299
views
Tag-free garbage collection for object oriented languages
I'm looking around for a good garbage collection technique for my language and found this paper, where Benjamin Goldberg describes a garbage collection technique for strongly typed languages, which ...
13
votes
2
answers
642
views
Are there any garbage collectors that take into account paging?
Garbage collections have to visit all objects that are alive, so as to find the memory that can be reclaimed. (Having many generations’ just delays this a bit)
All things being equal, it is ...
38
votes
2
answers
2k
views
Are generational garbage collectors inherently cache-friendly?
A typical generational garbage collector keeps recently allocated data in a separate memory region. In typical programs, a lot of data is short-lived, so collecting young garbage (a minor GC cycle) ...