The garbage-collection tag has no wiki summary.
8
votes
10answers
979 views
Is garbage collection necessary? [duplicate]
Do any languages really need garbage collection? Is there not a way to figure out when a object should be destroyed? I haven't had leaks in C++ and i dont use smart pointers or reference counters or ...
2
votes
2answers
542 views
What degree of low-level programming can be achieved with Languages like Go?
Go and D provide garbage collection, and yet they claim to be system programming languages. What degree of low-level programming can be achieved with languages having garbage collection?
For ...
8
votes
2answers
224 views
Is Non-Deterministic Resource-Management a Leaky Abstraction?
From what I can see, there are two pervasive forms of resource-management: deterministic destruction and explicit. Examples of the former would be C++ destructors and smart pointers or Perl's DESTROY ...
14
votes
1answer
208 views
When a garbage collector compacts objects in the heap, does it change the references on the stack?
This seems like a simple question, but after a lot of reading on the subject, I still haven't found a definitive answer (perhaps because it is so simple).
My question is this: when a garbage ...
8
votes
2answers
207 views
How does a concurrent garbage collector deal with variables?
Let's say it is a concurrent mark-and-sweep garbage collector.
When such GC handles constant pointers it just walks through them (starting from roots), and marks every encountered data block. Then ...
10
votes
4answers
851 views
When to use weak references in .Net?
I have not personally come across a situation where I've needed to use WeakReference type in .Net, but the popular belief seems to be that it should be used in caches. Dr Jon Harrop gave a very good ...
3
votes
2answers
264 views
Memory management for fast message passing between threads in C++
Suppose there are two threads, which communicate by asynchronously sending data messages to each other. Each thread has some kind of message queue.
My question is very low level: What can be expected ...
3
votes
1answer
146 views
Is it appropriate to try to control the order of finalization?
I'm writing a class which is roughly analogous to a CancellationToken, except it has a third state for "never going to be cancelled". At the moment I'm trying to decide what to do if the 'source' of ...
5
votes
4answers
707 views
Which part of the Memory is used for the Garbage Collector?
I understand the Heap memory divisions such as Young, tenured and Perm Gen.
But I'm just curious from where is the memory used for performing the Garbage Collector itself? Is it from any of these ...
13
votes
7answers
539 views
How does a garbage collector prevent the whole memory from being scanned on every collect?
Some (at least Mono's and .NET's) garbage collectors have a short term memory area which they scan often, and a secondary memory area which they scan less often. Mono calls this a nursery.
To find ...
9
votes
6answers
1k views
Should java developers know about garbage collection algorithms?
I have been recently asked in an interview if I know about any garbage collection algorithms.
I knew what garbage collection is but I never really thought about learning about garbage collection ...
8
votes
7answers
792 views
Entry level engineer question regarding memory management
It has been a few months since I started my position as an entry level software developer. Now that I am past some learning curves (e.g. the language, jargon, syntax of VB and C#) I'm starting to ...
2
votes
1answer
431 views
How the Erlang get soft-realtime with GC?
Generally GC is not a good choice to get a soft real-time attribute. But Erlang is GC based language can be soft real-time.
Does it mean Erlang have almost no GC latency? How does it work?
18
votes
3answers
955 views
Do all functional languages use garbage collection?
Is there a functional language which allows to use stack semantics - automatic deterministic destruction at the end of the scope?
7
votes
2answers
482 views
Why don't mobile platforms support generational garbage collection?
Both Windows Phone/Xbox and Android lack support for generational garbage collection. This is frustrating for a lot of programmers. There seems to be a legitimate engineering reason to it, but I can't ...
8
votes
8answers
710 views
What are the complexities of memory-unmanaged programming?
Or in other words, what specific problems did automated garbage collection solve? I've never done low-level programming, so I don't know how complicated can freeing resources get.
Update - apologies ...
3
votes
3answers
225 views
Are tree structures inherently bad for mark-and-sweep garbage collector performance?
I'm implementing a bounding volume hierarchy in F#. Since it would be for a game, I want the garbage collector to be as quick and infrequent as possible.
It seems though that I may have to pull some ...
2
votes
6answers
453 views
How assertive should I be in handling exceptions in objects?
I have been writing in C# 4.0 a lot lately and trying to write as lean as possible. As such, I have not been using the classic try/catch blocks and using statements as often.
I understand the general ...
22
votes
16answers
5k views
Why do languages such as C and C++ not have garbage collection, while Java does?
Well, I know that there are things like malloc/free for C, and new/using-a-destructor for memory management in C++, but I was wondering why there aren't "new updates" to these languages that allow the ...
17
votes
7answers
1k views
Why does Garbage Collection only sweep the heap?
Basically, I've learned so far that garbage collection erases forever any data structure that is not currently being pointed to. But this only checks the heap for such conditions.
Why doesn't it also ...
9
votes
2answers
407 views
Is there a need for Garbage Collection in a Stack Based Language?
This may be a stupid question but I cannot figure out the need for Garbage Collection in a Stack based language. In a language like Forth or RPL (on HP Calculators) is there a need for Garbage ...
12
votes
4answers
688 views
What are the algorithms behind low pause GC?
Some languages, for exemple java, introduced a low pause GC.
Those GC can do most of the work without pausing the whole world. This is obviously a quite hard problem because it require to analyze the ...
21
votes
9answers
3k views
Why Garbage Collection if smart pointers are there
These days, so many languages are garbage collected. It is even available for C++ by third parties. But C++ has RAII and smart pointers. So what's the point of using garbage collection? Is it doing ...
5
votes
2answers
298 views
Best refresher material on Java Garbage Collection?
I haven't looked at Java Garbage Collection for a while and feel the need for a refresher on it.
Anyone recommend a resource or two?
4
votes
8answers
939 views
How common are circular references? Would reference-counting GC work just fine?
How common are circular references? The less common they are, the fewer hard cases you have if you are writing in a language with only reference counting-GC. Are there any cases where it wouldn't ...
