Questions tagged [garbage-collection]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
Myk's user avatar
  • 173
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 (...
RIVERMAN2010's user avatar
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 ...
thebear8's user avatar
  • 101
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 ? (...
jsonphy's user avatar
  • 21
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 ...
Ta Thanh Dinh's user avatar
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 ...
Ian Ringrose's user avatar
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 ...
user avatar
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 ...
Patrick Roberts's user avatar
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 ...
Daniel Shapero's user avatar
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 ...
Milton Silva's user avatar
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 ...
Carl Dong's user avatar
  • 239
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, ...
mindreader's user avatar
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 ...
Ray Toal's user avatar
  • 267
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 ...
Daphne Preston-Kendal's user avatar
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 ...
Ian Ringrose's user avatar
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 ...
Jake's user avatar
  • 3,790
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 ...
babou's user avatar
  • 19.4k
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 ...
dbcb's user avatar
  • 423
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 ...
Ian Ringrose's user avatar
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 ...
MathiasVP's user avatar
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 ...
Ian Ringrose's user avatar
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) ...
Gilles 'SO- stop being evil''s user avatar