garbage-collection

GC.Collect()

Ok, I've read a couple of topics about it, but here it goes. Let's imagine I have an application where basically every now and then I will click on a button, a lot of things will happen for a couple of minutes, and then it'll stay idle possible for another hour, or maybe just 1 minute. Wouldn't just after that whole ended a good situatio...

Garbage collection in .Net 4.0

Is there any change in .Net 4.0 garbage collector execution? ...

What exactly gc_heap::plan_phase does?

Hello, I'm trying to debug a .net windows service that is spending lot of his time in GC. Using windbg during collections I discovered that most of the time is spent in: 00000000`0279e8e0 00000642`7f5368a3 mscorwks!WKS::gc_heap::plan_phase+0x50c 00000000`0279ea90 00000642`7f94ef4e mscorwks!WKS::gc_heap::gc1+0x73 00000000`0279eae0 000...

C# .NET Linq Memory Cleanup or Leak?

I have a large 2GB file with 1.5 million listings to process. I am running a console app that performs some string manipulation then uploads each listing to the database. I created a LINQ object and clear the object by assigning it to a new LinqObject() for each listing (loop). When the object is complete, I add it to a list. Whe...

What does "GC--" mean in a java garbage collection log?

We've turned on verbose GC logging to keep track of a known memory leak and got the following entries in the log: ... 3607872.687: [GC 471630K->390767K(462208K), 0.0325540 secs] 3607873.213: [GC-- 458095K->462181K(462208K), 0.2757790 secs] 3607873.488: [Full GC 462181K->382186K(462208K), 1.5346420 secs] ... I understand the first and ...

Java input = "" isn't the same as input = null?!

I'm running a J2ME Application and run into some serious memory problems. So I built in another step to clear the huge input string and process its data and clear it. But it didn't solve the problem until I set input = null and not input = "". Shouldn't it be the same in terms of memory management? Can somebody explain me the difference...

C# Explicitly Removing Event Handlers

Hi, I was wondering if setting an object to null will clean up any eventhandlers that are attached to the objects events... e.g. Button button = new Button(); button.Click += new EventHandler(Button_Click); button = null; button = new Button(); button.Click += new EventHandler(Button_Click); button = null; etc... Will this cause a...

close, dispose, finalize, GC, Idisposable,.... have you got a clear description of them ?

hi all i am completely confused about close, dispose, finalize, GC, Idisposable. Oh, could you please send me a clear description of them? ...

Am I crazy to recreate a tiny garbage collection system inside my functions?

I have some (C++) functions each containing several calls creating similar arrays of the same basic type on the heap. At various points in these functions, I may need to throw an exception. Keeping track of which arrays have been deleted is a pain, and quite error prone, so I was thinking about just adding the array pointers to a Set<Arr...

Multiple "= new" in vb.net with the same variable. Does garbage collection dispose and how?

Dim x as whatever Try x = new whatever(1) something is done with x x = new whatever(2) something is done with x Catch Finally x.dispose End Try What happens to x = whatever(1) Does garbage collection find the pointer to the first new and destroy it or what? ...

Dispose question

When you have code like: Bitmap bmp = new Bitmap ( 100, 100 ); Graphics g = Graphics.FromImage ( bmp ); Pen p = new Pen ( Color.FromArgb ( 128, Color.Blue ), 1 ); Brush b = new SolidBrush ( Color.FromArgb ( 128, Color.Blue ) ); g.FillEllipse ( b, 0, 0, 99, 99 ); g.FillRegion ( b, pictureBox1.Region ); pictureBox1.BackColor = Colo...

How to use lua_pop() function correctly ?

Hi! Can anyone pls tell me that how to use lua_pop() function correctly in C++. Should I call it when I use a lua_get*() function ? like. lua_getglobal(L, "something"); lua_pop(L, 1); or how to use it ? Will the garbage collector clear those stuff after the threshold ? Thanks. ...

Why can't the garbage collector figure out when objects referencing eachother are really orphaned

I understand that in a managed language like Java or C# there is this thing called a garbage collector that every once in a while checks to see if there are any object instances that are no longer referenced, and thus are completely orphaned, and clears then out of memory. But if two objects are not referenced by any variable in a progra...

Using AutoZone garbage collector

Has anyone tried to use the autozone garbage collector from Apple? Or can you point to a good and configurable one usable with C++? edit: I work on decision diagrams (like BDD), so I would like to test if managing the memory with a garbage collector is efficient in this case. edit 2: To be more precise, when implementing a library for ...

AS3 Object Filtering

Ok. so I'm working on an app that retrieves items from a db and builds a gallery. I've done this a ton of times, and it should be simple. I'm running into problems, because in this gallery, I get results from a db that includes both image files, and other files. Let's just say I can't change anything but the flash, so I need to detect i...

Wait for Garbage Collection of a specific object

I was just digging around in the commons-io library and found this: Keeps track of files awaiting deletion, and deletes them when an associated marker object is reclaimed by the garbage collector. This can be found in the documentation for the FileCleaningTracker object. Now I am just curious how I can do this by myself? How can my ...

Is it worth mitigating against the effects of garbage collection?

I have an application where the memory profile looks something like this: The slow upwards crawl of memory usage is caused by the allocation of lots and lots of small, simple, transient objects. In low-memory situations (This is a mobile app) the GC overhead is noticeable when compared to less restrictive memory amounts. Since we kno...

Is it possible to 'see' the object graph for garbage collection?

I have a Java application that is leaking memory. I know which objects are not being freed during garbage collection, but I can't work out what is referencing them. Is it at all possible to have some sort of visibility of the object graph that is being held internally by the JVM? It is at all otherwise possible to find out which object...

Python - printing out all references to a specific instance

I am investigating garbage collection issues in a Python app. What would be the best readable option to print out all variables referencing a specific instance? ...

Cost of using weak references in Java

Has anyone researched the runtime costs involved in creating and garbage collecting Java WeakReference objects? Are there any performance issues (e.g. contention) for multi-threaded applications? EDIT: Obviously the actual answer(s) will be JVM dependent, but general observations are also welcome. ...