garbage-collection

Does invoking System.gc() in java suggest garbage collection of the tenured generation as well as the young generation?

一曲冷凌霜 提交于 2020-01-24 05:21:10
问题 When invoking System.gc() in java (via JMX), it will dutifully (attempt to) clean the young generation. This generally works very well. I have never seen it attempt to clean the tenured generation, though. This leads me to two questions: Can the tenured generation even be collected (i.e. is there actually garbage in this generation, or do all objects in the tenured generation actually still have live references to them)? If the tenured generation can be collected, can this be done via System

Knockout ViewModel computed garbage collection

烂漫一生 提交于 2020-01-24 04:56:11
问题 I've been trying to track down any issues with garbage collection within my application code. I've stripped it down to pure knockout code and there seems to be an issue collecting created objects depending on how a computed property is created. Please see the following JS fiddle: http://jsfiddle.net/SGXJG/ Open Chrome profiler. Take a heap snapshot Click Make All Take another heap snapshot Compare the snapshots Test2 & Test3 still remain in memory while Test1 is correctly collected. Please

Garbage Collection in Java with Recursive Function

烂漫一生 提交于 2020-01-24 04:52:09
问题 I know that objects become unreachable and marked for garbage collection in every iteration of a regular loop. What about recursive calls? Something like: public void doWork() { Object a = new Object(); ....some work with a... this.sleep(60000); doWork(); } Is the object (i.e. 'a') in the first recursion marked for garbage collection once the second recursion begins or does it need to be explicitly marked null since the outer function never finishes because of the recursion. 回答1: During each

Could increase gc time short lived object that has references to old lived object?

好久不见. 提交于 2020-01-24 04:20:17
问题 I need some clarification about how minor gc collections behave. calling a() or calling b() in a long-lived application, if they could behave worstly when old space gets bigger //an example instance lives all application life cycle 24x7 public class Example { private Object longLived = new Object(); public void a(){ var shortLived = new ShortLivedObject(longLived); // longLived now is attribute shortLived.doSomething(); } public void b(){ new ShortLivedObject().doSomething(new Object()); //

Does JMC Flight Recording force Full GC?

假如想象 提交于 2020-01-24 00:40:28
问题 I am experiencing some performance related issues (works ok most of the time, and from time to time there's a spike in the response time from 100ms to 4/5s with no apparent reason) in services implemented in OSB. One of the hypothesis to explain this situation is the fact that the JVM could be performing a Full GC during those spikes and we are monitoring the JVM using mission control. The admins tell me that the jvm is running with full gc's disabled, using G1GC and I can see that in the

Error: cannot allocate vector of size X Mb in R

泪湿孤枕 提交于 2020-01-23 13:25:11
问题 I have question regarding memory usage in R. I am running a Rcode on our entire database in R in a for loop. However, the code stops at some point saying that it cannot allocate a vector of size 325.7 mb. When I was looking at the task manager I saw that it was using 28gb of RAM on our server. I am familiar with the gc() function in R but this does not seems to work. E.g. the code stopped working on the 15th iteration, saying that it cannot allocate the vector. However, if I only run the 15th

Why Garbage Collector doesn't collect Tasks objects

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-23 13:24:08
问题 especially when no live Thread reference it. I thought GC goes thought all .net threads to find references... Does it check references in other places too? EDIT: FOr instance let's imagine we are in a console app, the main calls a method that creates a local task1, then applies a task1.ContinueWith(task2) and returns to main, main do console.readline(). At this point it could be that task1 has finished, task2 still has not started a GC could start and no thread has a reference to task2. Why

G1GC long pause with initial-mark

青春壹個敷衍的年華 提交于 2020-01-23 11:25:27
问题 With j7u5, G1GC "-Xms3200m -Xmx3200m -XX:+UseG1GC -XX:ParallelGCThreads=14 -XX:ConcGCThreads=4 -XX:MaxGCPauseMillis=40 -XX:NewRatio=2 -XX:SurvivorRatio=10 -XX:+PrintGC -XX:+PrintGCDateStamps" for a given performance test, my application hits a long pause after 5-hour run predictably. Except this big one (and only), there are small initial-mark phases. Any suggestions to figure out what is happening to this long pause and how to tune it to avoid such a long pause which affects the latency

Can Python's garbage collection guarantee the reclaiming of circular referenced objects under all circumstances?

↘锁芯ラ 提交于 2020-01-23 10:43:05
问题 This question is an extension of a question I asked earlier: Python Delegate Pattern - How to avoid circular reference? After reading the replies, I decided to clarify my question, but was requested to post it separately. Here goes: A passage in the Python docs (reproduced below) states that garbaged collection is not guaranteed for circular referenced objects. A post I found here suggests the same thing. But the replies to my earlier question disagrees. So, have I misunderstood the passage

Can Python's garbage collection guarantee the reclaiming of circular referenced objects under all circumstances?

浪尽此生 提交于 2020-01-23 10:42:27
问题 This question is an extension of a question I asked earlier: Python Delegate Pattern - How to avoid circular reference? After reading the replies, I decided to clarify my question, but was requested to post it separately. Here goes: A passage in the Python docs (reproduced below) states that garbaged collection is not guaranteed for circular referenced objects. A post I found here suggests the same thing. But the replies to my earlier question disagrees. So, have I misunderstood the passage