I have my java application configured to use 5G memory. I got an OutOfMemory out of blue. I inspected the gc log and found plenty of memory left: young generation occupies 4% allocated space, tenure generation occupancy is 5% and perm generation is 43%. I am puzzled why JVM throws an OutOfMemory at the gc time. Does anyone know why this ...
BACKGROUND:
In running my app through a profiler, it looks like the hotspots are all involved in allocating a large number of temporary new byte[] arrays.
In one run under CLR Profiler, a few short (3-5 seconds worth of CPU time outside the profiler) produced over a gigabyte of garbage, the majority of it byte[] allocation, and this t...
I'm not sure whether the following questions are valid.To educate myself i am just asking.
( 1 ) Can I programmatically iterate the GC Heap of all generations ?
( 2 ) Is it possible to watch how does the GC operate on my assembly by launching a thread ?
...
I have a web application that is eventually running out of memory when it runs on IIS 7 Windows Server 2008. When I attempt to run a memory profiler against the application to determine the leak, it is not reproducible on my development workstation...Windows Vista.
The GC collection cycles are not consistent between the server and the ...
Periodically I program sloppily. Ok, I program sloppily all the time, but sometimes that catches up with me in the form of out of memory errors. I start exercising a little discipline in deleting objects with the rm() command and things get better. I see mixed messages online about whether I should explicitly call gc() after deleting lar...
In my application there is a specific time when a number of large objects are all released at once. At that time I would like to do a garbage collection on specifically the large object heap (LOH).
I'm aware that you cannot do that, you must call GC.Collect(2) because the GC is only invoked on the LOH when it is doing a generation 2 co...
.NET profilers can show reference count to managed objects. How do they count them?
...
I want to implement some reusable object pool. Also I don't want to have API that puts the object back to pool when it is not needed.
I want to use garbage collector to inform me that it is going to remove the object because it has no references, so that I could stop the object from being garbage collected and put it back to the pool. ...
I have an object, which lives forever. I am deleteing all references I can see, to it after using it, but it still not collected. Its life cycle is pretty sophisticated so I can't be sure that all references been cleared.
if ( container.Controls.Count > 0 )
{
var controls = new Control[ container.Controls.Count ];
container.Con...
I'm running some performance tests on some .NET code that processes lots of data. I want some tests that ensure the garbage collector isn't influencing my results. How do I temporarily pause the garbage collector?
...
My class contains a socket that connects to a server. Some of the methods of the class can throw an exception. The script I'm running contains an outer loop that catches the exception, logs an error, and creates a new class instance that tries to reconnect to the server.
Problem is that the server only handles one connection at a time (...
I frequently see python code similar to
for line in open(filename):
do_something(line)
When does filename get closed with this code?
Would it be better to write
with open(filename) as f:
for line in f.readlines():
do_something(line)
...
Can I trust that an object is destroyed and its destructor is called immediately when it goes out of scope in C#?
I figure it should since many common coding practices (e.g. transaction objects) rely on this behaviour, but I'm not very used to working with garbage collection and have little insight to how such languages usually behave.
...
Hello there,
Please anyone can tell me if I can force garbage collection in java anyway? Even it was tricky to do. I know about System.gc(); and Runtime.gc(); but they don't force, they suggest to do GC, but actually no force occurs. Please I need that horribly.
Best Regards,
Tarek,
...
I've been reading up on garbage collection looking for features to include in my programming language and I came across "weak pointers". From here:
Weak pointers are like pointers,
except that references from weak
pointers do not prevent garbage
collection, and weak pointers must
have their validity checked before
they are...
Hi.
I'm fixing a User control component using the .NET 1.1 framework.
There are many instances of this user control referencing a singleton wrapping a COM resource.
They subscribe to events from this resource.
I suspect that the reason why we are having a degrading performance is because the singleton is maintaining a reference to t...
My team is incorporating the Python 2.4.4 runtime into our project in order to leverage some externally developed functionality.
Our platform has a 450Mhz SH4 application core and limited memory for use by the Python runtime and application.
We have ported Python, but initial testing has highlighted the following hurdles:
a) start-...
I need a library to handle computational geometry in a project, especially boolean operations, but just about every feature is useful. The best library I can find for this is CGAL, but this is the sort of project I would hesitate to make without garbage collection.
What language/library pairs can you recommend? So far my best bet is i...
If I have a class declared in assembly A, and am listening to it in assembly B, will this prevent garbage collection. Its a common situation, such as the one where you are listening to a property of an object in the business model from the ui.
i saw this question which talks about event listeners and garbage collection, but this questio...
I know that Javascript has a garbage collector. Therefor, using delete remove only a reference to the object, and when there is no more reference to this object, it is deleted by the GC.
Javascript is tricky, with the closures, the fuzzy name space and the prototype inheritance, it's not always obvious to know when to now or why.
I am ...