I have a java program that uses a weak hashmap for caching some things, if java needs more memory the weak hashmap is cleared. This works fine for me. Now I also have a c# program on the same computer running and recognized the following.
When the java program is running my c# program is not running correctly at times when the computer ...
How to dispose objects in a Singleton WCF service? I am using Entity Framework (3.5) and returning a bunch of custom POCO objects to the client. The service needs to be alive as it provides cross-client communication and hence Duplex binding is used. I would like dispose all the POCO objects created once they are serialized to the client...
I'm using gc module to debug a leak.
It's a gui program and I've hooked this function to a button.
I've set set debug more to gc.SAVE_ALL
> gc.collect()
>
> print gc.garbage
and this is the output
[(<type '_ctypes.Array'>,), {'__module__': 'ctypes._endian', '__dict__': <attribute '__dict__' of 'c_int_Array_3' objects>, '__weakr...
Guys,
I am interested to find out how many objects were reclaimed by the garbage collector after I run the following code.
if (ObjectsOutstanding > GCThreshold) {
System.GC.Collect();
}
Could you please help me out with this one?
...
I just read this question and the accepted answer: http://stackoverflow.com/questions/864516/what-is-javascript-garbage-collection
In the answer, Noldorin referenced some guidelines from apple. Here is the part I'm concerned with:
Use delete statements. Whenever you create an object using a new statement, pair it with a delete sta...
How can I purposely overflow my memory, to force garbage collection?
Can someone propose algorithm like this:
while ( garbage collector starts ) {
overflow my memory with something easily disposable
}
Edit:
To everyone that purposed GC.Collect method. I've always tought, that GC can not be forced to occur programmaticaly. Guess,...
Hi
I have to solve a following problem.
there are many files let's say 3 for example, with the following content
file1
a1
a2
a3
a4
a5
a6
......
file2
b1
b2
b3
b4
b5
b6
......
file3
c1
c2
c3
c4
c5
c6
......
my program has to take filenames in parameter, read those files and print the following result
"a1 b1 c1"...
I have few questions regarding java GC and memory management.
In java we define process memory upper bound and lower bound by xmx and xms parameters. Using these parameters JVM allocates young old and perm space. So if new threads are created then from which memory do stacks memory is allocated to threads? is it from perm space or any ...
I have read somewhere that Perm gen space is not garbage collected. But in CMS collection I can see some classes unloading log. So does perm gen space is grabage collected in case of full collection or CMS collection.
...
I know about flag -XX: PretenureSizeThreshold which can be used to set to limit the size of allocations in YG.
Apart from that is there any other scenario/condition where new objects can be allocated space from tenure space ?
what heppens if new object size is larger than the eden space ? will the Young generation GC happens or the o...
If I call hashcode() method on some oject it returns the internal address of the object(default implementation) . Is this address logical one or physical address.
In garbage collection, due to memory compaction objects shifting takes place in the memory. If I call hashcode before and after the GC, will it return the same hashcode (it ...
In case the answer is obvious, please don't be hard on me, i'm still new to Cocoa.
I recompiled the iMedia framework to make use of garbage collection, which it officially supports, according to their issue tracker (tracker entry).
iMedia parses iTunes' XML library file and loads everything into an NSDictionary (i call it "monster dicti...
From what I've read about cpython it seems like it does reference counting + something extra to detect/free objects pointing to each other.(Correct me if I'm wrong). Could someone explain the something extra? Also does this guarantee* no cycle leaking? If not is there any research into an algorithm proven to add to reference counting to ...
I accidentally added, committed and pushed a huge binary file with my very latest commit to a Git repository.
How can I make Git remove the object(s) that was/were created for that commit so my .git directory shrinks to a sane size again?
Edit: Thanks for your answers; I tried several solutions. None worked. For example the one from Gi...
I am new to Java and confused about the garbage collector in Java. What does it actually do and when does it comes into action. Please describe some of the properties of the garbage collector in Java.
...
Moving garbage collectors, such as generational collectors, incur extra generated code to store and reload references across GC safe points. Has anyone quantified the performance cost of this overhead compared to a non-moving collector?
I ask because I am interested in designing a collector that can recycle short-lived values efficientl...
Is a "static final" directly allocated into young gen or old gen or perm gen? (I guess it will most likely land into old gen over the time I suppose.) If it is allocated in the perm gen then, will it be garbage collected when class unloading takes place in Perm Gen ?
...
I have DB connection .
the question is when I do the "next()" for getting data from DB, why the garbage collector runs simultaneoulsly. Cause of the GC , collectiing data from DB is so slow.
How can I solve this out?
...
Hi!
I am experiencing a memory leak with a code similar to the one below (it's a simulation with different inputs at every loop).
The problem
The object Object_XXX is quite complex, with connections to databases and other objects populated with data from databases aswell.
for(int i=0; i<MAX; i=i+1){
Class_XXX Object_XXX ...
In Java, finalize is called on an object (that overrides it) when it's about to be garbage collectioned, so when it's unreachable. But what if the finalizer makes the object reachable again, what happens then?
...