garbage-collection

Class unloading in java

When a classloader is garbage collected, are the classes loaded by it unloaded? When the JVM is running is verbose mode, all the loaded classes are o/p. Similarly will the JVM log when it unloads a class? I wrote a custom class loader to test this, but could not see any verbose log for unloading of the classes. CustomClassLoader loader...

Can anybody tell me about Generation of Garbage Collector in .net

Can anybody tell me about Generation of Garbage Collector in .net ? ...

Do I need getters and setters if i'm depending on garbage collection in objective-c

New to Cocoa and Objective-c. Do I need getters and setters if I'm depending on garbage collection? For example is it safe to just modify instance variables directly without the dot syntax? And in the dealloc method can I sent them to nil instead of release (or do I even have to release them)? ...

Pointers, am I using them correctly? Objective-c/cocoa

I have this in my @interface struct track currentTrack; struct track previousTrack; int anInt; Since these are not objects, I do not have to have them like int* anInt right? And if setting non-object values like ints, boolean, etc, I do not have to release the old value right (assuming non-GC environment)? The struct contains objects...

Objective-c garbage collection

If garbage collection is not required: - (void) awakeFromNib{ //Create the NSStatusBar and set its length statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain]; ... Do I have to release that? And if I do, would that be in a finalize method or dealloc method? If garbage collection is requ...

Will the following code be Garbage Collected before the class "dies"?

Let's say we have the following code in a class: //class code TextBox t = new TextBox(); ListBox l = new ListBox(); We have then two possible situations: In the first, we declare qem1 as a class variable(or attribute, as they call it in the Java World): //class variable QuickEntryMediator qem1 = new QuickEntryMediator(t,l); In the...

How to get GC Information in Silverlight?

Silverlight does not provide perfmon counters for GC. How do i get GC Information? Thanks ...

Why is the destructor called when the CPython garbage collector is disabled?

I'm trying to understand the internals of the CPython garbage collector, specifically when the destructor is called. So far, the behavior is intuitive, but the following case trips me up: Disable the GC. Create an object, then remove a reference to it. The object is destroyed and the __del__ method is called. I thought this would onl...

C# creating a Class, having objects as member variables? I think the objects are garbage collected?

So I have a class that has the following member variables. I have get and set functions for every piece of data in this class. public class NavigationMesh { public Vector3 node; int weight; bool isWall; bool hasTreasure; public NavigationMesh(int x, int y, int z, bool setWall, bool setTreasure) { //defau...

How can I find out at runtime what garbage collection algorithm is configured in my JVM?

I have an instance of Tomcat 6.0.18 running on Sun's Java HotSpot(TM) Server VM build 1.6.0_14-b08. Is there any way for me to find out what garbage collection algorithm the JVM is using to run my web application? ...

Difference between background and concurrent garbage collection?

I read that with .NET Framework 4 the current garbage collection implementation is replaced: The .NET Framework 4 provides background garbage collection. This feature replaces concurrent garbage collection in previous versions and provides better performance. At this page there is an explanation how it works but I am not su...

weak references and garbage collection

Suppose I have a weak reference to a car which has an ordinary reference to an engine. No other references to the car or the engine exist. Can the engine be garbage collected? ...

Is there a way to launch an aggressive and complete garbage collection in Java?

For memory optimization reasons, I'm launching myself the garbage collector during profiling, to check if objects are correctly cleaned after disposing of them. The call to garbage collector is not enough, though, and it seems that there is no guarantee of what it will clean. Is there a way to call it, to be sure it will recover as muc...

Android Force Recycle Large Bitmap?

From another stackoverflow question, it seems that Android handles large bitmaps differently than other memory. It also seems like there is a way to force Android to recycle the bitmaps to free up memory. Can anyone enlighten me on how to do this. My application uses 2-6 huge bitmaps at all times, so it nearly kills the phone's memory ...

Android Pausing and Resuming Tutorial

I'm having some difficulty figuring out the best ways to pause and resume my application. Is there any comprehensive tutorial or something similar that would help me make sure that I'm not missing any important steps? Mostly I'm just worried about not dealing with the memory being used by my application. There's a few apps I own that w...

Alternative for Garbage Collector

As in question, I'd like to know best alternative for garbage collector, with it's pros and cons. My priority is speed, memory is less important - if there is gc which doesn't make any pause, let me know. EDIT: maybe I should add, that I'm working on safe language, and garbage collecting or its alternative has to be used ...

Doubts about .NET Garbage Collector

I've read some docs about the .NET Garbage Collector but i still have some doubts (examples in C#): 1)Does GC.Collect() call a partial or a full collection? 2)Does a partial collection block the execution of the "victim" application? If yes.. then i suppose this is a very "light" things to do since i'm running a game server that uses 2-...

How to tie a background thread to the lifetime of an object?

I want to create a background thread that's owned by an object. When that object is no longer needed, so is its background thread. pseudo code of what I currently have: ResetEvent _isCanceled ResetEvent _hasWork ThreadSafeQueue _workItems Init() new BackgroundThread(ThreadLoop).Start() AddWork(work) _workItems.Enqueue(work) _ha...

.NET Windows Service, threads and garbage collection (possible memory leaks)

I am developing a .NET Windows service that is creating a couple of threads and then uses these threads to send print jobs to printers (there is a thread for each printer). I have some issues which sometimes can be fixed by restarting the service. Some issues also arise when the service has been running for a while. This makes me suspect...

Garbage collection - manually wiping EVERYTHING!

I have been building a game for a while (nearly done) - But the game needs a replay button and its a big task. I know the GC is dreadful in flash, but I wanted to know if there is a way to wipe EVERYTHING as if the flash app has just begun. Clearing memory, game data - I haven't to worry about game loading as its not really heavy on dat...