garbage-collection

CreateEntityManagerFactory is growing in size . Is it leaking memory?

public class SoapMessageProcessor { private EntityManager em; private static final Logger logger = Logger.getLogger(SoapMessageProcessor.class); public SoapMessageProcessor() { try { EntityManagerFactory emFactory = Persistence.createEntityManagerFactory("Auditing"); em = emFactory.createEntityManager(); } catch...

Is there an official reference stating that battery life is one of the reasons why a Garbage Collector was not included inside iOS?

In the following SO question, it is mentionned that the Garage Collector was not included in iOS in order to conserve battery power. Is there an offical reference from Apple stating that battery life is one of the reasons why a Garbage Collector was not included inside iOS? I have been looking for it on google but was not able to find...

Is there any research on (or better use of) of RAII in GC languages?

Note: Object Lifetime RAII not using/with block scope RAII It seems like its possible using an extra gc category, short lived objects(check gc category somewhat frequently), long lived objects(check gc category less frequently), and resource objects(check gc category very frequently). Or possibly with an extra reference counting gc for ...

c# multithreading mem usage - App slowing down and CPU usage drops.

I've got a multithreaded app that manipulates in-memory data (no database or network access). I tried this on 2 machines, one machine is Xeon dual quad core CPU, the other is twin dial-cores. 5 threads are spawned. Then this multithreaded process starts it runs very quickly and the CPU usage is at 60% for 5 cores, the physical memory is...

Mechanism of the Boehm Weiser Garbage Collector

I was reading the paper "Garbage Collector in an Uncooperative Environment" and wondering how hard it would be to implement it. The paper describes a need to collect all addresses from the processor (in addition to the stack). The stack part seems intuitive. Is there any way to collect addresses from the registers other than enumeratin...

A design issue with a tree of information in C++.

Sorry in advance for the lengthy explanation! I have a C++ application that uses a hash_map to store a tree of information that was parsed from a text file. The values in the map are either a child hash_map or a string. These values were parsed from a text file and then stored into the map. I wanted to avoid having to send the strings ...

In what situation will the object clear up by GC.Collect()?

I am writting a software in Silverlight with C#. I know that GC.Collect will collect the Objects and Controls if they are non-referenced. But in detail, I am not so sure how is exactly means by non-reference. I know that in Silverlight, I have to remove the Control (say called "Control A") from the Layout, take out all the event handle...

VBScript seems to be GC'ing objects from nested scopes in the wrong order.

I have the following code: function p (str) Response.Write VBLF & str end function function nop: end function class Test1 private sub class_initialize p "Test1 Start" end sub private sub class_terminate p "Test1 End" end sub end class class Test2 private sub class_initialize p " Tes...

Memory usage increase when the Controls render in Silverlight?

Hello Everyone, I just want to get more understanding about Silverlight. I notice that if I created a Control object in C#, the memory usage is not increased much in the application (by reading the Memory (Private Working Set) in Task Manager). But when I add the Control into the Silverlight layout to display the control, the memory u...

Java Garbage Collector clarification

Right now I'm reading this article regarding Java Garbage Collection: http://www.javaworld.com/javaworld/jw-08-1996/jw-08-gc.html? Here is a snippet of a function in a JMS client public void foo(){ ...//Create Connection factory, connection, and session, topic TopicSubscriber tp = session.createDurableSubcriber(topic,"001"); ...

How to make my Haskell code use Lazyness and Garbage collector

Hi I wrote a Haskell code which has to solve the following problem : we have n files : f1, f2, f3 .... fn and I cut those files such a way that each slice has 100 lines f1_1, f1_2, f1_3 .... f1_m f2_1, f2_2, .... f2_n ... fn_1, fn_2, .... fn_k finally I construct a special data type (Dags) using slices in the following way ...

End Java command line application properly

Hi, I am just wondering. Do I need to call System.exit(0); right before main method of a Java command line application ends? If so, why? What is the difference from letting it exit on its own, if I would just always put there 0? What is not cleaned up? Thanks in advance. ...

AS3 Specify if there are unvisible displayObjects with active listeners

Is there any way to count (specify) the avarage amount of objects that are removed from stage and has active listeners? I have really big project(game), more than 100 classes.. Now i scan each classes, if there are active unnecessary listeners i remove them. Now, i wanna such a tool, which will tell me where is there any other unnecessa...

What's The Difference Between Java GC Log Lines? ("Total time for which..." vs "[GC")

Java Version: 1.6.0_20 I'm seeing the following in my logs, and I'm trying to figure out the difference beween the first line and the subsequent lines. As far as I know, they are both minor GC related, however there isn't a 1-to-1 between them as there usually is in other GC tutorials I've read. I know how to interpret the first line,...

any haXe GC tips?

Recently I am learning haXe for flash, and I have few actionscript3 experience. HaXe is really good language. I notice there is a delete operation in as3, Is there some like delete in HaXe? Is the "delete" about gc? Is there any tips for haXe newbie about memory management, thanks? ...

Why doesn't every OOP runtime allow manual deletion (garbage collection) of object instances?

You can create new objects, but when you've finished using them there's no real way to destroy them immediately as well? Why didn't every OOP runtime implement such behaviour? I'm sure we as developers could (often) organize for object instances to be destroyed when we've finished using them. function work(){ var p1:Point = new Po...

How can I reproduce this .NET Garbage Collection scenario

Here is a great article about GC may occur at unexpected point of code execution: Lifetime, GC.KeepAlive, handle recycling – by cbrumme http://blogs.msdn.com/b/cbrumme/archive/2003/04/19/51365.aspx?wa=wsignin1.0 My question is how can I reproduce forced GC at the point mentioned in the article? I tried to put GC.Collect() at beginning ...

Big O analysis of garbage collection runtime cost

When reasoning about runtime cost in a garbage collected language, what is the cost of a statement such as myList = null; in terms of 'n' (the number of elements in the list)? For sake of argument, consider the list to be a singly linked list of reference types with no finalisation required. More generally, I'm looking for any informat...

Java GC Stop and copy

This question is a follow up to my previous Java GC question: http://stackoverflow.com/questions/3729058/java-garbage-collector-clarification This question is also referring to the same article. I'm a little confused on why the stop and copy method for defragmenting object heap allocation is so commonly used. Yes it defragments the hea...

Should I encapsulate blocks of functionality in anonymous JavaScript functions?

My intuition is that it's a good idea to encapsulate blocks of code in anonymous functions like this: (function() { var aVar; aVar.func = function() { alert('ronk'); }; aVar.mem = 5; })(); Because I'm not going to need aVar again, so I assume that the garbage collector will then delete aVar when it goes out of scope. Is this rig...