Subject:
|
Re: Are there GOTO statements in NQC?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Fri, 21 Nov 2003 15:56:45 GMT
|
Original-From:
|
T. Alexander Popiel <popiel@wolfskeep.+spamless+com>
|
Viewed:
|
1460 times
|
| |
| |
In message: <HooKJH.CF3@lugnet.com>
"Brian B. Alano" <throwaway@insightbb.com> writes:
> Don't know about C/C++, but IIRC in Java the garbage collector destroys
> objects not when they are out of scope, nor when their creator function
> exits. It destroys them when the object is no longer referenced by any
> threads. That is to say, if there's no variable or other object holding
> a reference to the object, then the object is inaccessible, so it might
> as well be killed.
Actually, this is a common misconception. In Java, there is no guarantee
that memory is _ever_ reclaimed. It is perfectly permissible by the
specification (and quite common in embedded applications) that garbage
collection is _never_ done. At most, you can politely ask the VM to
clean up some unreachable memory, at which point it may choose whether
to do so or not.
Needless to say, this makes writing and running Java in memory-constrained
situations very dicey.
- Alex
|
|
Message is in Reply To:
| | Re: Are there GOTO statements in NQC?
|
| Don't know about C/C++, but IIRC in Java the garbage collector destroys objects not when they are out of scope, nor when their creator function exits. It destroys them when the object is no longer referenced by any threads. That is to say, if (...) (21 years ago, 21-Nov-03, to lugnet.robotics)
|
19 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|