garbage-collection
Running Boehm GC in multiple threads independently
I don’t have an answer about how to do this with Boehm. However, here are two GCs which seem to have enough control and encapsulation to have a totally independent GC context per-thread. Lua’s Garbage Collector – MIT Steve Dekorte’s libgarbagecollector – BSD
Practical use of System.WeakReference
One useful example is the guys who run DB4O object oriented database. There, WeakReferences are used as a kind of light cache: it will keep your objects in memory only as long as your application does, allowing you to put a real cache on top. Another use would be in the implementation of weak event … Read more
In Java is Permanent Generation space garbage collected?
The PermGen is garbage collected like the other parts of the heap. The thing to note here is that the PermGen contains meta-data of the classes and the objects i.e. pointers into the rest of the heap where the objects are allocated. The PermGen also contains Class-loaders which have to be manually destroyed at the … Read more
Difference between Xms and Xmx and XX:MaxPermSize
Java objects reside in an area called the heap, while metadata such as class objects and method objects reside in the permanent generation or Perm Gen area. The permanent generation is not part of the heap. The heap is created when the JVM starts up and may increase or decrease in size while the application … Read more
GHC’s RTS options for garbage collection
Generally speaking, garbage collection is a space/time tradeoff. Give the GC more space, and it will take less time. There are (many) other factors in play, cache in particular, but the space/time tradeoff is the most important one. The tradeoff works like this: the program allocates memory until it reaches some limit (decided by the … Read more
Why doesn’t this thread pool get garbage collected?
This doesn’t really have anything to do with GC being non-deterministic, although it doesn’t help! (That is one cause in your example, but even if we ‘fixed’ it to eat up memory and force a collection, it still wouldn’t finalize) The Worker threads that the executor creates are inner classes that have a reference back … Read more
Garbage collection notification?
As of Java7u4, you can get notifications from the GarbageCollectorMXBean. See http://docs.oracle.com/javase/7/docs/jre/api/management/extension/com/sun/management/GarbageCollectionNotificationInfo.html
Circular references in Javascript / Garbage collector
Any half-decent garbage collector will handle cycles. Cycles are only a problem if you do naive reference counting. Most garbage collectors don’t do ref-counting (both because it can’t handle cycles, and because it’s inefficient). Instead, they simply follow every reference they can find, starting from “roots” (typically globals and stack-based variables), and mark everything they … Read more
How can I disable Java garbage collector?
It sounds like you are trying to save time, but going about it the wrong way. The time saved in disabling garbage collection would be trivial (for a single task) compared to the time taken to launch and shutdown the java process. You might want to consider having a java process launch that you can … Read more