topics

全部话题 - 话题: gced
1 (共1页)
F****n
发帖数: 3271
1
Again, what you mean by "dispose"? There is no "dispose" for non-top containers. If you mean the tree is removed from the container, then the listener will generally do no harm. If you mean the tree is GCed, then the listener must have been GCed already.
There is no such case as the listener tries to do something to a GCed tree, because if the listener has a reference to the tree then the tree won't be GCed.
g*****g
发帖数: 34805
2
来自主题: Java版 - a garbage collection question
It's not gonna be GCed as the Vecotor keeps an ref to the string.
It will be GCed only when v is GCed, that will be end of progam
as v is static.
Vector, memory pool, resource conn (DB, network) is where you 'll
find memory leak in Java.
m******t
发帖数: 2416
3

express
good
There is a difference between "referred objects will never be GCed"(not true),
and "reachable objects will never be GCed"(true).
IMHO, explicitly setting references to null essentially defeats the purpose of
having gc in Java - to relieve programmers from memory management.
I've always been a strong believer of Java gc, and I think I'm going to
continue
to be one, based on its track record with me.
R***Z
发帖数: 1167
4
来自主题: Java版 - Another garbage collection question
In Java, suppose obj A has a reference to obj B, obj B has a reference to obj
C, and obj C has a reference to obj A. And no one else has any reference to
these 3 objs. So each of them has a reference count of 1. But they should
really be GCed because they are not reachable by any means. How does the
garbage collector know these 3 objs can be GCed? Thanks.
r*****l
发帖数: 2859
5
来自主题: Java版 - Singleton
Once the class is loaded, the static variables are loaded and initialized.
They live while the class lives. Therefore, the references they hold live
while the class lives. Singleton instance is one of the references.
The single instance can only be GCed if there is no strong reference to it,
i.e. when the ClassLoader that loaded the singleton is GCed.
r****t
发帖数: 10904
6
In Python, everything (file descriptor, sockets, etc etc...) is automatically closed/GCed when the last name referring to it goes out of its scope.
但是要记得 shutdown socket。
socket is a different story. Supposedly you should shutdown() and then close() your connection. So, imagine you forgot about one socket you created, when it is GCed, socket.close() is automatically called. That'll close your side of the connection (you are fine) but leave the other side of connection wait forever: because he/s
S*****0
发帖数: 538
7
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
EB2, TSC, PD 11/2005
握手。
A*********r
发帖数: 8271
8
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
恭喜啊,恭喜!!!!
A*********r
发帖数: 8271
9
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
握手。
S*****0
发帖数: 538
10
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
暑假放多久?
u****9
发帖数: 1888
11
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
GXGX
m*****h
发帖数: 2292
12
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
cong
A*********r
发帖数: 8271
13
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
两个多月。
w*******y
发帖数: 693
14
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
congrats
g**t
发帖数: 993
15
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
congrats
N****w
发帖数: 21578
16
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
cong! 包子
z********o
发帖数: 3895
17
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
GXGX!
p*****r
发帖数: 150
18
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
CONG
z*****1
发帖数: 2210
19
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
恭喜
z***b
发帖数: 4667
20
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
cong
w***c
发帖数: 709
21
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
GX!
j****g
发帖数: 587
22
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
Congratulations!
Can you share information how to RELINK?
Thanks.
k*****o
发帖数: 983
23
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
congrats
g*****y
发帖数: 1864
24
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
GXGX!
S*****0
发帖数: 538
25
来自主题: Immigration版 - April MM, 在你的带领下,我也GCed
I didn't do relink, sorry. But there should be plenty of information on this
board.
R***Z
发帖数: 1167
26
【 以下文字转载自 Java 讨论区,原文如下 】
发信人: RainZ (雨人...迷航), 信区: Java
标 题: Another garbage collection question
发信站: Unknown Space - 未名空间 (Fri Dec 3 18:48:46 2004) WWW-POST
In Java, suppose obj A has a reference to obj B, obj B has a reference to obj
C, and obj C has a reference to obj A. And no one else has any reference to
these 3 objs. So each of them has a reference count of 1. But they should
really be GCed because they are not reachable by any means. How does the
garbage collector know these 3 obj
st
发帖数: 1685
27
only when there's no reference to the object, it's GCed. set this explicityly
can save you a lot trouble.
g*****g
发帖数: 34805
28
There is no way to explicitly invoke GC, although call System.gc will express
your desire and likely the gc thread's priority will increase. However,
refered objects will never be GCed. Set large unused object to null is a good
style every java programmer should follow.

not
of
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
definitely
B******N
发帖数: 445
29
sorry! wrong logic.
I really means this:
...
Point point = new Point(2,4);
Rectangle rectangle = new Rectangle(point, 20, 20);
mVector.add(point):
point = null;
....
in this case point = null dosn't make sure point is GC.
in the original post the "point" is GCed, because the "rectangel" is not
really hold the "point" reference, it just get it's x and y value. It's
different as you put it in an array or vector. Whether the "rectangle" GC
depends on Context.

collection
both
object
m******t
发帖数: 2416
30
来自主题: Java版 - Integer in heap

up
Note that unless you have -incgc turned on, the GC may not kick in until
there isn't any free memory left, i.e., you might not see these Integers
GCed even though they are not in use any more.
F****n
发帖数: 3271
31
1. In my implementation, I use addListener(l, reftype), so if you want a
weak reference you should use this method explicitly, and know how it works.
That is to say you will keep a listener reference somewhere inside your
tree and so it will not be GCed until the tree itself is un-referenced.
Again, this is only for argument's sake. If you have developed disposable UI
, you should know anonymous class listener is NEVER a problem: if you want a
UI to be disposed, you MUST NOT use unreferenced ano
g*****g
发帖数: 34805
32
while the document is being processed, it's unlikely your soft ref is the
only ref. So it won't be GCed. And if it's not being processed, it should
have no reference in the system. soft ref is for cache, not for this.
r********r
发帖数: 208
33
来自主题: Java版 - 为什么结果是3?
double[] bestTimes = new double[4];
...
bestTimes = Arrays.copyOfRange(times, 1, 4);
The above 2 bestTimes's refer to 2 different arrays, and the memory referred
by the former will be GCed sooner or later.
Correct me if I am wrong.
z***y
发帖数: 42
34
来自主题: Linux版 - Google go 还挺不错的
It is not easy. But check out the Singularity OS from Microsoft. The
kernel runtime is GCed.
1 (共1页)