Re: Java daemon
On 11/13/2012 1:40 AM, SL wrote:
I did some google'ing on garbage collector (GC) in java and found that it is
a big and complicated topic.
It certainly is.
Java programmer has no permission to invoke it directly, beside juggling its
settings to adjust its frequency of running and the type of collector to
run. Even then how the GC is invoked stilll lies beyond programmer's
control.
It gets me thinking.
Why bother with it (people in the finance trade especially) ? Are the
advantages so great over c/c++ ?
Yes.
GC is a lot better than manual deallocation for non realtime
usage as programmer tend to forget to deallocate resulting
in memory leaks.
And there are also other areas where the programmers end up
misusing the control that C++ provides you.
If the answer is yes, I can only think that
the reason is portability.
That is one reason but there are plenty of other.
Otherwise forget about tweaking GC;
Yes. Because 99.999% of developers can not do a better job than what
the GC specialists has designed.
go for C/C++;
programmer has full control over memory management,
Which is a very good reason for not choosing C/C++ unless you
have special requirements like realtime, hardware interface or
kernel code.
and it is faster than
java.
That is not always the case.
I do have a question on GC: how to run the GC continuously ? Create a
thread, do some memory juggling to induce the GC to run ?
The GC should not run continuously - that would be very bad for
performance.
Arne