I am running an application server on Linux 64bit with 8 core CPUs and 6 GB memory.
The server must be highly responsive.
After some inspection I found that the application running on the server creates rather a huge amount of short-lived objects, and has only about 200~400 MB long-lived objects(as long as there is no memory leak)
Aft...
Hi!
I know that Lua is gc-ed. I know that Lua can deal with c objects via userdata.
Here is my question: is there anyway to register a function so that it's called when a C userdata object is gc-ed by lua? [Basically a destructor].
Thanks!
...
Hi Guys
I would like to run a Java program with garbage collection switched off. Managing memory in my own code is not so difficult.
However the program needs quite a lot of I/O.
Is there any way (short of using JNI for all I/O operations) that I could achieve this using pure Java?
Thanks
Daniel
...
class GCTest {
static Object r1;
static void Main() {
r1 = new Object();
Object r2 = new Object();
Object r3 = new Object();
System.GC.Collect(); // what can be reclaimed here ?
r1 = null;
r3.ToString();
System.GC.Collect(); // what can be reclaimed here ?
}...
How do I keep a count of the number of times that objects of a specific class (type?) are getting disposed in the lifetime of my application. Imagine I have a class A, now, I want to count how many times the objects of A get collected by the GC.
I hope I am phrasing this right because I was asked this in an interview today and the answ...
I was reading the C# entry on Wikipedia, and came across:
Managed memory cannot be explicitly freed; instead, it is automatically garbage collected.
Why is it that in languages with automatic memory management, manual management isn't even allowed? I can see that in most cases it wouldn't be necessary, but wouldn't it come in hand...
What happens when I press the "Run Garbage Collector" button in Eclipse? Does it just call System.gc()?
...
Will garbage collector free resources for cross referenced object/class, which is no longer referenced from main program.
For example -
class class1
{
class2 m_RefClass2;
}
class class2
{
class1 m_RefClass1;
}
class class3
{
public class3()
{
class1 obj1 = new class1();
class2 obj2 = new class2();
...
I'm looking for arguments as to how best to size the young generation (with respect to the old generation) in an environment where low latency is critical.
My own testing tends to show that latency is lowest when the young generation is fairly large (eg. -XX:NewRatio <3), however I cannot reconcile this with the intuition that the large...
If I have the following block of code in a method (using .NET 4 and the Task Parallel Library):
var task = new Task(() => DoSomethingLongRunning());
task.Start();
and the method returns, will that task go out of scope and be garbage collected, or will it run to completion? I haven't noticed any issues with GCing, but want to make sur...
I've been developing a minimalistic Java rich client CRUD application framework for the past few years, mostly as a hobby but also actively using it to write applications for my current employer.
The framework provides database access to clients either via a local JDBC based connection or a lightweight RMI server. Last night I started a...
Possible Duplicate:
How does the JVM ensure that System.identityHashCode() will never change?
I was just wondering how System.identityHashCode() is able to always yield the same result for a given object, even if the garbage collector moves it around in memory. Does every object have an additional invisible field storing its i...
I'm running a java application with the following settings:
-XX:+CMSParallelRemarkEnabled
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps
-XX:+PrintHeapAtGC
-XX:+PrintTenuringDistribution
I'm not sure ho...
Hi,
My app shows rising 'Old Generation'/'Tenured Generation' size, and when this reaches the max limit for 'Old Gen', then suddenly PermGen size increases.
Here are my generation sizings:
-Xmx1200m -Xms1200m -Xmn450m -XX:MaxPermSize=600m -XX:+UseParallelGC
This is on 32 bit Fedora so can't have a bigger heap than this.
The app is n...
The problem: Registered event handlers create a reference from the event to the event handler's instance. If that instance fails to unregister the event handler (via Dispose, presumably), then the instance memory will not be freed by the garbage collector.
Example:
class Foo
{
public event Action AnEvent;
pu...
It's well known that Apple does not provide automatic garbage collection on the iPhone to prolong battery life. Yet MonoTouch apps, which reportedly run perfectly on the iPhone (and many are sold through the AppStore, therefore are approved by Apple), do have automatic garbage collection.
Is this automatic garbage collection, or does M...
From questions posted here and an old one of mine I have created the impression that you cannot explicitly run the Java Garbage Collector whenever you please.
If you call it, you simply instruct the system to call it whenever it can or thinks is appropriate.
But in eclipse, if you press the "Run Garbage Collector" button you see an imm...
We're in the middle of debugging some memory issues. We were watch 5 instances of the same app. We stopped 3. The Gen2 Heap size went from about 5M to almost 10M, and the Gen0 and Gen1 heap sizes changed insignificantly.
This is the exact opposite of what I'd expect. I expected it to reduce in size, and would never expect it to incre...
I suppose it is an interesting code example.
We have a class, let's call it Test with Finalize method. In Main method here is two code blocks where i am using lock statement and Monitor.Enter call. Also i have two instances of class Test here.
The experiment is pretty simple - nulling Test variable within locking block and try to collec...
A List does not work in the way that I want. The way that I want is that WeakReferences are automatically removed from the list when the object they weakly reference is garbage collected.
ConditionalWeakTable does not do what I want either, because although its keys and values are weakly referenced and collectable, you cannot enumerate ...