SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Technology Stocks : Apple Inc.
AAPL 273.67+0.6%3:59 PM EST

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Phillip C. Lee who wrote (10804)4/3/1998 4:58:00 PM
From: Alomex  Read Replies (2) of 213177
 
How can any compiler take care of virtual machine when it runs without interpreter?

It works as follows. You download bytecode that is executed initially on an interpreter while the JIT process is under way. A profiler finds out the methods used most often and compiles them into native code. Because of object encapsulation, you can have the methods of an object be executed outside the VM and just plug back the results into the VM. At the same time, agressive memory management impements an LRU policy on objects in memory. Since no user pointers are allowed, you can easily and efficiently rellocate objects in memory.

What do you mean level 2 of cache?

It seems to me that you are unfamiliar with how data and instructions are loaded from RAM into cache for fast access. Whenever a page of data is accessed, the cache management policy decides if the data will be copied into local cache and who it will displace.

Yes, Java has no pointer, but it still needs memory swapping.

You can minimize this swapping if you can rearrange data dynamically at run time. Java's lack of pointer and garbage collection abilities allow you to do just that in an efficient way.

Actually, pointer is the quickest way and most efficient way to manipulate memory. Java has no pointer, but it still needs memory swapping.

Only if you are accessing consecutive memory space. Otherwise, indirect addressing through an LRU policy will beat pointer addressing any time. Implementing such an scheme in C++ is devilishly complicated, because of pointers. In Java you get it (almost) for free with the Garbage Collection.

Java is on the average about 20 times slower than c/c++ (stated in Java in a Nutshell book).

That is interpreted, non-optimized Java. Here's a quote, from a more upto date source:

HotSpot promises to rival native platform performance of C++ with so-called adaptive optimization, permitting Java code to run first in interpreted mode and then be analyzed and optimized to target the parameters of each platform, said Eric Chu, JavaSoft's Java Development Kit (JDK) product manager.
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext