A
amalikarunanayake
java has become an important language in very short time. What are
some of the things that have made it so popular?
some of the things that have made it so popular?
java has become an important language in very short time. What are
some of the things that have made it so popular?
java has become an important language in very short time. What are
some of the things that have made it so popular?
java has become an important language in very short time. What are
some of the things that have made it so popular?
java has become an important language in very short time. What are
some of the things that have made it so popular?
Jack said:One of the biggest reasons JAVA has taken off, is its ease of portability.
When an application is written in a language like C or C++, it must be
compiled separately for each platform that will run your application.
Java has a virtual machine that is able to take JAVA code information and
translate it to the specific machine running the application on the fly. It
makes it so you do not have to re-compile the application for every
platform.
There are some downsides to this; JAVA is generally slower than a language
like C++ because of the extra time needed by the Virtual Machine. With how
fast computers are today, most people do not care about the performance
penalty in their applications (the penalty is usually pretty small now).
java has become an important language in very short time. What are
some of the things that have made it so popular?
java has become an important language in very short time. What are
some of the things that have made it so popular?
Microsoft dislikes it, and tried unsuccessfully to poison it.
Microsoft dislikes it, and tried unsuccessfully to poison it.
Every time you ship a JAR, a little fairy in Redmond dies.
Every time you ship a JAR, a little fairy in Redmond dies.
I think that should be: "Every time you ship a jar, a big fairy
in Redmond dies." They're pretty big out there in Redmond.
One of the biggest reasons JAVA has taken off, is its ease of portability.
When an application is written in a language like C or C++, it must be
compiled separately for each platform that will run your application.
Java has a virtual machine that is able to take JAVA code information and
translate it to the specific machine running the application on the fly. It
makes it so you do not have to re-compile the application for every
platform.
There are some downsides to this; JAVA is generally slower than a language
like C++ because of the extra time needed by the Virtual Machine. With how
fast computers are today, most people do not care about the performance
penalty in their applications (the penalty is usually pretty small now).
If we are talking about arbitrary applications then that only works forraddog58c said:For instance, someone was asking me about checking for an already-
running instance of a program on a Windows workstation. That's a
really easy thing to implement in any language that can talk directly
to the OS -- about 15 lines of code invoking EnumWindows.
On the other hand if we are talking about testing for an instance ofYou can't do that in Java, however, unless you go JNI.
I would say "the penalty is usually pretty small now" is very context
sensitive. Not to pick on you personally, but the general embracing
of the "memory is cheap" or "performance is good enough" is popular in
the Java community, and it's wrong to me. Maybe that's because I use
everything from MASM to IBM 370 BASM to C, C++, Java, VB and Perl, not
sure...
Rubbish. You can do quite a lot of useful work with the JVM 'using' onlyBut I would never, or at least rarely, use Java for desktop utilities
I create for myself because the startup time is dreadfully slow, and
the impact on other applications is large. If you're running a system
with a GIG or less of RAM, firing up a memory-hungry JVM isn't
Look who is making blanket statements. I care a lot about performance,Performance is the biggest drawback to using Java, maybe its only big
drawback, and that's why I'm such a huge opponent against blanket
statements that ignore this side of the Java tradeoff.
If we are talking about arbitrary applications then that only works for
applications that actually have a window.
On the other hand if we are talking about testing for an instance of
your own application (written in Java) then that is possible without
resorting to JNI.
Sometimes the penalty can be zero or even negative, particularly for
applications which run long enough to eliminate the startup effects of
JIT compiling.
Rubbish. You can do quite a lot of useful work with the JVM 'using' only
8MB or less which is trivial in the context of 1GB memory. I've been
running a service, written in Java, which has no noticeable effect on
the responsiveness of my normal applications. It sits there all day
doing its stuff and I can easily forget that it is still running. My
machine is a 4 year old 3.06GHz Pentium with 1GB of RAM.
Look who is making blanket statements. I care a lot about performance,
but I don't have a problem in this respect with Java. Java isn't
perfect. For some applications it can be slower than say C++, but in
other cases it can be just as fast (or even faster).
Mark said:You can do quite a lot of useful work with the JVM 'using' only
8MB or less [...]
raddog58c said:How can it negative? I'm not saying you're wrong, but how can any
byte-coded language outperform a binary language if they are doing the
same thing? It can't, because you have to convert the byte code to
the native binary stream before you can execute it.
How does one get Java to run faster than a compiled language?
[...]
Rubbish. You can do quite a lot of useful work with the JVM 'using' only
8MB or less which is trivial in the context of 1GB memory. I've been
running a service, written in Java, which has no noticeable effect on
the responsiveness of my normal applications. It sits there all day
doing its stuff and I can easily forget that it is still running. My
machine is a 4 year old 3.06GHz Pentium with 1GB of RAM.
No doubt, and Java's fine messaging implementation and rich set of
protocol support, eg, makes it a good vehicle for such things. A
service I'm fine with -- a utility I need to fire up over and over,
not so fine with that. I wouldn't write that in Java.
How does one get Java to run faster than a compiled language? It
would seem there has to be a catch or specific circumstances for that
to occur, because it's hard to fathom how that could be the case.
At least in theory, the JVM's JITer has more information available to it than a
compiler producing a statically pre-compiled binary would have. Some
theoretical examples:
Is the machine /actually/ a multiprocessor ? If not then some synchronisation
primitives can be replaced by no-ops.
Is a (virtual) method /actually/ overridden by any class loaded at runtime ?
If not then optimisations like static linking or even inlining become possible.
Does the processor have an extended instruction set ? If so then the JITer can
generate code which uses those instructions. (A statically precompiled binary
could include both sets of code, of course, with dynamic switching between
them, but that is not often deemed worth the extra bother).
As far as I know, all of those possibilities are implemented (if only in
limited ways) in current Sun JVMs.
Simple: compare it with a compiled language with a bad optimiser ;-)
FWIW, I think it is /highly/ application dependent, and there is no simple set
of rules you can follow to make Java run as fast as possible. My impression is
that the optimiser in the server JVM, from 1.5 (and presumably later) generates
code which is comparable with GCC -o3 or MS's C++ compiler with all obvious
optimisations turned on -- however that is a useless observation unless the
code in the two languages is trying to do the same thing (e.g. 2-D arrays have
different layouts in C and Java, or a calculation might create many
intermediate objects in carefully-written Java whereas the "same" code in
well-crafted C++ might not).
Chris said:Mark Thornton wrote:
You can do quite a lot of useful work with the JVM 'using' only
8MB or less [...]
How do you configure it to use so little memory ? Presumably you are not
counting the space taken by the JVM's own code in that figure.
Also, is 8MB the amount of memory /reserved/ or the amount actually /used/ ?
(I'm assuming a Windows host, not sure if the same distinction makes sense on
Unixy OSes).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.