garbage-collection

How to measure sum of collected memory of Young Generation?

Hi, I'd like to measure memory allocation data from my java application, i.e. the sum of the size of all objects that were allocated. Since object allocation is done in young generation this seems to be the right place. I know jconsole and I know the JMX beans but I just can't find the right variable... Right at the moment we are parsi...

Does allocation speed depend on the garbage collector being used?

My app is allocating a ton of objects (>1mln per second; most objects are byte arrays of size ~80-100 and strings of the same size) and I think it might be the source of its poor performance. The app's working set is only tens of megabytes. Profiling the app shows that GC time is negligibly small. However, I suspect that perhaps the al...

IoC and dataContext disposing in asp.net mvc 2 application

I have the Global.asax like the code below: public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { // .... } protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); ControllerBuilder...

When are constant Strings created/destroyed ?

Consider the following code public static void method(String[] srgs){ try{ }catch(){ System.out.println("Hello World" + "one");} catch(..){ System.out.println("Hello World" + "two");} catch(..){ System.out.println(getString());} } When are these Strings created? I assume the Strings will get created when an Exception occ...

JVM memory management & garbage collection book?

Hi. Could anyone advice a book (or any other source) that would thoroughly reveal internals of JVM memory management & garbage collection (optimization, work, circular references, pecularities, discussions for various JVM impls...)? [What I've found so far are separate articles devoted to various aspects but no weighty tome :). Some goo...

garbage collection in session will take place when session managing with database in php?

How or when garbage collection with session will take place in case of session managing with database in php? I done session management with database. But it is not deleting the user details who completed the time of expiration. ...

What's keeping this timer in scope? The anonymous method?

Ok, So I have a method which fires when someone clicks on our Icon in a silverlight application, seen below: private void Logo_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { e.Handled = true; ShowInfo(true); DispatcherTimer autoCloseTimer = new DispatcherTimer(); autoCloseTimer.Inter...

How to free virtual memory ?

I have a crawler application (with C#) that downloads pages from web . The application take more virtual memory , even i dispose every object and even use GC.Collect() . This , have 10 thread and each thread has a socket that downloads pages . In each thread , i have a byte[] buffer that store content of page , and have an string str_...

How static variable treated by gc

How are static variable treated by the garbage collector and where are they allocated memory? on the heap or stack (as member variables) Please clarify this for me. ...

How to avoid GeneratedSerializationConstructorAccessor problems?

We have a Java App that receives SOAP requests, and after a lot of requests we notice that the GC stops the world to unload a lot of GeneratedSerializationConstructorAccessor classes. This is a big performance impact. Does anyone know how to avoid this or at least significantly reduce the count of GeneratedSerializationConstructorAccess...

Garbage collection in Perl

Unlike Java, Perl uses reference count for garbage collection. I have tried searching some previous questions which speak about C++ RAII and smart pointers and Java GC but have not understood how Perl deals with the circular referencing problem. Can anyone explain how Perl's garbage collector deals with circular references? Is there an...

JVM with no garbage collection

I've read in many threads that it is impossible to turn off garbage collection on Sun's JVM. However, for the purpose of our research project we need this feature. Can anybody recommend a JVM implementation which does not have garbage collection or which allows turning it off? Thank you. ...

Quantifying the Performance of Garbage Collection vs. Explicit Memory Management

I found this article here: Quantifying the Performance of Garbage Collection vs. Explicit Memory Management http://www.cs.umass.edu/~emery/pubs/gcvsmalloc.pdf In the conclusion section, it reads: Comparing runtime, space consumption, and virtual memory footprints over a range of benchmarks, we show that the runtime performan...

Perl graph garbage collection usage

Hi, I have built a tiny application in Perl that displays a graph over time. It graphs garbage collection usage over time. I use gnuplot to display the actual graph. This works fine if the time period is short, like a few hours. However, as the time increases (say a few days), the graph becomes difficult to read as the information ge...

How much does Javascript garbage collection affect performance?

I'm writing a bunch of scripts that present images serially (e.g. 1 per second) and require the user to make either a keyboard or mouse response. I'm using closures to handle the timing of image presentation and user input. This causes garbage collection to happen pretty frequently and I'm wondering if that will affect the performance (...

Is it possible to implement a GC.GetAliveInstancesOf<T>() (for use in debugging)?

Hi, I know this was answered before, but I'd like to pose a somewhat different question. Is there any conceivable way to implement GC.GetAliveInstancesOf(), that can be evaluated in Visual Studio Debug Watch window? Sasha Goldstein shows one solution in this article, but it requires every class you want to query inherit from a specific...

How to safely transfer reference to object across window?

I'm debugging a web application. Javasript in one window create one object and use it as argument to invoke global method in another window. Pseudo code is like below. var obj = new Foo(); anotherWin.bar(obj); In anotherWin, the argument is stored in global variable. var g_obj; function bar(obj) { g_obj = obj; ... } When oth...

Keeping track of links or references to image files and deleting unused ones (PHP/Database)

I need a way to remove "unused" images from my filesystem, i.e. images that are never accessed from any point in my website (doesn't matter if I break external links. I might disable external hotlinking altogether). What's the best way of going about this? Regular users can add multiple attachments to topics/posts and content contributer...

How do you keep a list of objects in C# that does not interfere with garbage collection?

Hiya, I'm trying to maintain a list of objects in a Manager class in C#. Basically a consumer class registers with the Manager class and the manager class maintains a collection of references to the consumer class. Now as far as my (limited) understanding of GC goes, keeping a reference to the consumer class will prevent the consumer c...

TreeNodes don't get collected with weakevent solution

Hi, When I use this method http://stackoverflow.com/questions/1089309/weak-events-in-net (by Egor) to hook up a event i a inherited treenode, the tree node never gets collected, is there any speciall case with tree nodes and GC? public class MyTreeNode : TreeNode { public MyTreeNode(Entity entity) { entity.Children.ListC...