garbage-collection

Is this all for Garbage Collection in Objective-C?

Hi I just picked up Obj-C and quite dislike its manual memory management. I decide to go with its Garbage Collection, by adding objc_startCollectorThread();//garbage collection in my Main() and change the garbage collection value to [-fobjc-gc] So is that all I need? So I can program "freely" like I do in Java/Python..etc? ...

GC.Collect in a loop?

I found this piece of code inside System.Web.ISAPIRuntime using Reflector public void DoGCCollect() { for (int i = 10; i > 0; i--) { GC.Collect(); } } Can anyone comment on this? Is there a reason to do GC.Collect() in a loop? Why 10 times and not 3, 5 or 20? Analysis indicated that it's not used inside .net framew...

Will GC close objects once Page is Rendered?

Hi I have a SharePoint WebPart that I made and I override the Render method. My question is how long does an object live before the GC cleans it up? I created a StringReader object in the Render function, I am just wondering will it be disposed of once the page has rendered or will I have to explicitly call the .Close method. Could ...

Using and Garbage Collection

Hi just to clairfy if I have the following: using (Object1) { create Object2 } // bookmark1 Will Object2 be destroyed at bookmark1 along with Object1? Object2 is of StringReader and Object1 is of MemoryStream. ...

Ruby symbols are not garbage collected!? Then, isn't it better to use a String?

If you create 10,000 strings in a loop, a lot of garbage collection has to take place which uses up a lot of resources. If you do the same thing with symbols, you create objects which cannot be garbage collected. Which is worse? ...

What happens when a JSP finishes execution?

Hi, When a JSP finishes execution, will all variables declared in the JSP page be put up for garbage collection? If I declare a number of memory intensive Hashtables in the JSP, and I let the JSP finish execution without setting the variables to null beforehand, will the object stay in memory even after the JSP has finished executing? ...

How do you prevent IDisposable from spreading to all your classes?

Start with these simple classes... Let's say I have a simple set of classes like this: class Bus { Driver busDriver = new Driver(); } class Driver { Shoe[] shoes = { new Shoe(), new Shoe() }; } class Shoe { Shoelace lace = new Shoelace(); } class Shoelace { bool tied = false; } A Bus has a Driver, the Driver has t...

Is Objective-C on Linux garbage collected?

Objective-C v2.0 (which is what the mac uses) got a new feature, Garbage Collection. I'm a kid on a Linux PC (Ubuntu in case your wondering). So my question is, using the gcc/g++ compiler is Objective-C Garbage Collected? ...

Common Java memory/reference leak patterns?

Maybe the most typical example is the JDBC closing done wrong way and not handling the possible exceptions correctly. I am very curious to see other examples you have seen - preferably web application related. So, are there any common leak patterns in Java? ...

Does the GC still clean up if you end process in task manager?

I think I read somewhere recently (might even have been on SO but I can't find the question) that in a debug session, pressing stop in VS just kills the process and no GC takes place. However closing the app window normally performs GC as expected. Is this correct? Also, what happens when a (non-debug) process is killed in task manager...

What are ways to solve Memory Leaks in C#

I'm learning C#. From what I know, you have to set things up correctly to have the garbage collector actually delete everything as it should be. I'm looking for wisdom learned over the years from you, the intelligent. I'm coming from a C++ background and am VERY used to code-smells and development patterns. I want to learn what code-...

OpenGL, Java and memory management

When using openGL in Java (in bindings like jogl), do you have to worry about memory management? Does the JVM do garbage collection with the created openGL objects? If so, what's the best way to approach cleanup? ...

Why can't I leverage 4GB of RAM in my computer to process less than 2GB of information in C#?

Scenario: over 1.5GB of text and csv files that I need to process mathematically. I tried using SQL Server Express, but loading the information, even with BULK import takes a very long time, and ideally I need to have the entire data set in memory, to reduce hard disk IO. There are over 120,000,000 records, but even when I attempt to fi...

Please help us non-C++ developers understand what RAII is

Another question I thought for sure would have been asked before, but I don't see it in the "Related Questions" list. Could you C++ developers please give us a good description of what RAII is, why it is important, and whether or not it might have any relevance to other languages? I do know a little bit. I believe it stands for "Resour...

Strange garbage collection behaviour with Websphere Portal Server

We're running a fairly complex app as a portlet on Websphere Portal Server 5.1 on AIX using IBM JDK 1.4.2. On our production system I can see a strange behaviour in the verbose GC logs. After a period of normal behaviour the system can start rapidly allocating larger and larger blocks. The system starts to spend > 1000 ms to complete eac...

Ruby Garbage Collection: Mark non-exported variables

I have several structs bound with Data_Wrap_Struct to ruby objects and I also supplied mark() and free() functions. When I manually start the GC or just wait until it jumps in my ruby objects are killed. Nothing new so far. The strange thing is: When I try to protect these objects with rb_gc_register_address() nothing happens - my o...

I want to make my own Malloc

I want to make my own malloc/free so I can make a precise copying allocator. Any gurus have any tips and suggestions? I have a few questions for now: Should I just malloc large chunks of memory, and then distribute from that so I don't have to call the system calls? How are copying collectors usually done? I would imagine that this p...

What is the significance of having high pgfree/s on a linux system?

I am seeing high pgfree/s values in sar for an application. Generally is this an issue I should be concerned about? If so, what is generally the cause, spending time lots of time in GC? ...

Deleting Objects in JavaScript

I'm a bit confused with JavaScript's delete operator. Take the following piece of code: var obj = { helloText: "Hello World!" }; var foo = obj; delete obj; After this piece of code has been executed, obj is null, but foo still refers to an object exactly like obj. I'm guessing this object is the same object that foo pointed to. ...

In a long running Common Lisp application, what strategy should be used to manage garbage?

If I am hosting a long running application such as a web server within a Common Lisp image, what strategy should I use to manage the garbage collector? I'm assuming that, by default, the garbage collector is entitled to spend long periods of time sorting out the heap, at times I can't predict. This may impact a particular browser reques...