garbage-collection

What mechanisms other than mutexs or garbage collection can slow my multi-threaded java program?

早过忘川 提交于 2019-12-31 19:28:35
问题 Problem I have a piece of java code (JDK 1.6.0._22 if relevant) that implements a stateless, side effect free function with no mutexes. It does however use a lot of memory (I don't know if that is relevant). In the past I have visited Sun Laboratories and gathered the standard "performance vs number of threads" curve. As this function has no mutexs, it has a nice graph although the garbage collection kicked in as the number of threads increased. After some garbage collection tuning I was able

What are the disadvantages in using Garbage Collection? [closed]

不羁的心 提交于 2019-12-31 13:55:09
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Most of the modern languages have built in garbage collection (GC). e.g. Java, .NET languages, Ruby, etc. Indeed GC simplifies

Garbage collector tuning in Ruby 1.9

做~自己de王妃 提交于 2019-12-31 12:14:11
问题 I know about GC.enable/disable , but is there any way of controlling the Ruby 1.9 garbage collector in more detail? When profiling my code (using perftools.rb) I notice that the GC stands for up to 30% of the total samples, and I'd like to see if it's possible to tune the GC to decrease this number. Are there any environment variables or other means by which you can set the number of heap slots, the malloc limit, etc. like you can with REE? 回答1: Yep, for short. At first, basic constants,

Burst memory usage in Java

旧巷老猫 提交于 2019-12-31 11:41:01
问题 I am trying to get a handle on proper memory usage and garbage collection in Java. I'm not a novice programmer by any means, but it always seems to me that once Java touches some memory, it will never be released for other applications to use. In that case, you have to make sure your peak memory is never too high, or your application will continually use whatever the peak memory usage was. I wrote a small sample program trying to demonstrate this. It basically has 4 buttons... Fill class

Garbage collector in Node.js

一个人想着一个人 提交于 2019-12-31 10:49:48
问题 According to google, V8 uses an efficient garbage collection by employing a "stop-the-world, generational, accurate, garbage collector". Part of the claim is that the V8 stops program execution when performing a garbage collection cycle. An obvious question is how can you have an efficient GC when you pause program execution? I was trying to find more about this topic as I would be interested to know how does the GC impacts the response time when you have possibly tens of thounsands requests

Why does Lua use a garbage collector instead of reference counting?

你离开我真会死。 提交于 2019-12-31 09:34:50
问题 I've heard and experienced it myself: Lua's garbage collector can cause serious FPS drops in games as their scripted part grows. This is as I found out related to the garbage collector, where for example every Vector() userdata object created temporarily lies around until getting garbage collected. I know that Python uses reference counting, and that is why it doesn't need any huge, performance eating steps like Luas GC has to do. Why doesn't Lua use reference counting to get rid of garbage?

Why does Lua use a garbage collector instead of reference counting?

房东的猫 提交于 2019-12-31 09:34:03
问题 I've heard and experienced it myself: Lua's garbage collector can cause serious FPS drops in games as their scripted part grows. This is as I found out related to the garbage collector, where for example every Vector() userdata object created temporarily lies around until getting garbage collected. I know that Python uses reference counting, and that is why it doesn't need any huge, performance eating steps like Luas GC has to do. Why doesn't Lua use reference counting to get rid of garbage?

Why are weak pointers useful?

你离开我真会死。 提交于 2019-12-31 08:38:05
问题 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 used. Weak pointers interact with the garbage collector because the memory to which they refer may in fact still be valid, but containing a different object than it did

How to minimize the garbage collection in Go?

五迷三道 提交于 2019-12-31 08:37:05
问题 Some times you could want to avoid/minimize the garbage collector, so I want to be sure about how to do it. I think that the next one is correct: Declare variables at the beginning of the function. To use array instead of slice. Any more? 回答1: Avoiding garbage is relatively straight forward. You need to understand where the allocations are being made and see if you can avoid the allocation. First, declaring variables at the beginning of a function will NOT help. The compiler does not know the

OpenJDK's LinkedBlockingQueue implementation: Node class and GC [duplicate]

喜欢而已 提交于 2019-12-31 02:56:09
问题 This question already has answers here : Strange code in java.util.concurrent.LinkedBlockingQueue (4 answers) Closed last year . I'm a little confused by the structure of the Node class in OpenJDK's implementation of LinkedBlockingQueue (in java.util.concurrent). I've reproduced the description of the node class below: static class Node<E> { E item; /** * One of: * - the real successor Node * - this Node, meaning the successor is head.next * - null, meaning there is no successor (this is the