jvm

How Java Virtual Machine can work on system without virtualization support ?

If hardware support is a must for virtualization, how can Java Virtual Machines run on machines without support for virtualization ? Or is JVM not a virtual machine ? ...

Java Runtime Performance Vs Native C / C++ Code?

I've become more and more comfortable programming in Java than with C++ or C. I am hoping to get a sense of the performance hit incurred using a JVM interpreter, as opposed to executing the same "project" natively. I realize that there is some level of subjectivity here; the quality of the program will depend highly on a good implement...

Why doesn't the JVM cache JIT compiled code?

The canonical JVM implementation from Sun applies some pretty sophisticated optimization to bytecode to obtain near-native execution speeds after the code has been run a few times. The question is, why isn't this compiled code cached to disk for use during subsequent uses of the same function/class. As it stands, every time a program is ...

Override Java System.currentTimeMillis

Is there a way, either in code or with JVM arguments, to override the current time, as presented via System.currentTimeMillis, other than manually changing the system clock on the host machine? A little background: We have a system that runs a number of accounting jobs that revolve much of their logic around the current date (ie 1st of...

Java method call overloading logic

Hello, For the following code why does it print A, B? I would expect it to print B, B. Also, does the method call performed by the JVM is evaluated dynamically or statically? public class Main { class A { } class B extends A { } public void call(A a) { System.out.println("I'm A"); } public void...

What will Support for Dynamic Languages in Java 7 be like?

It seems JSR 292 will add support for dynamic languages to the JVM but I've not seen many details about it. Will dynamic types be incorporated into the language (or just the VM)? If so, what will the semantics look like? Will there be something like C# 4's: dynamic x = 10, y = 5; Console.WriteLine(x + y); ...

Java Crashing Windows

I have been developing a Java application using J2EE and a Derby database. My boss does most of the testing and I do most of the coding, but he has come to me with a strange problem. He claims that occasionally the Java application "crashes his computer". To mention a few details, first let me say that I am currently working remotely, s...

Java: Finding out *why* a class is loaded

Hello. I am currently having the problem that I have a (partial) program that is trying to load a class but fails because it cannot find this class. Looking at the stack trace, I cannot see any particular reason for why the VM tries to load this particular class at the first place. Are there any tools that would let me figure out why a ...

Running multiple JVMs

How do you run multiple JVMs on a single machine? How do you call methods in a different JVM? ...

When you unbox an object, where is the objects datatype stored so the compiler can perform the cast?

Internally speaking, when you cast an object to a strongly typed object like: User u = (User)o; Where is the type of the object stored? is it stored in another location or within the memory block where the actual object is stored? (I don't know much about this topic, so I could very well be asking a question that doesn't make comple...

Problem loading Java applets after creating VM in Internet Explorer

I have an Internet Explorer Browser Helper Object (BHO) that uses the JNI_CreateJavaVM() API to create a Java VM in the iexplore.exe process so that I can make JNI calls for my business logic. However, when I browse to sites that try and load Java applets (e.g., http://www.javatester.org/version.html), then the applet fails to load. If...

Java memory guideline

Likely a dumb question but.. Are there any good guidelines for how much memory basic Java data structures will consume? Ie: How much memory will be consumed by a simple POJO with an int member and a String member (say that holds a 10 char String)? How much memory would be consumed by a List of 10 of said objects? etc ...

If I set a system property with -D can I access it from my code?

I'd like to be able to set a property on the JVM using the -D switch. If I do that, can I access it from my code? If yes, how? ...

wasting memory to speed up jvm

On Linux & Mac, is there anyway that I can pre-cache the JVM (either in RAM, or a state of it) so taht when I start a Java program, it starts as fast as C/C++ programs? I am willing to waste memoory to make this happen. ...

How can I tell if I'm running in 64-bit JVM or 32-bit JVM?

How can I tell if the JVM my application runs in is 32 bit or 64-bit? Specifically, what function or preference do I access to detect this within the program? ...

jvm thread dump location.

Hi, when I issue a kill -3 command to my java program, its generates the thread dump on the console. How do I redirect this to a file? Tks! ...

Is there any way to compile gcc to support a single language?

I want to compile gcc so i can use the mips R2000 microprocessor compiler inorder to use NestedVM a way of targeting any executable to the java vm; but I don't want it to compile the modules for other languages than mine or architectures other than the R2000 or the Mips family. ...

Where is exactly is the demarkation between a version of Java and the JVM?

Where is exactly is the demarkation between a version of Java and the JVM? I'm asking because of a recent 'educational' comment thread with a fellow SOpedian regarding the default buffer size of java.io.BufferedInputStream, which I see is 8192. (Has it always been 8192?) When thinking about just the API, it is clear to be what is wh...

Why should a Java developer learn an additional JVM language?

I am a java developer and I want to know, what is the main benefit from learning a language such as Scala or Groovy? ...

Avoid memory fragmentation when allocating lots of arrays in Java

I am developing an application in Java that runs on Windows Mobile devices. In order to achieve this we have been using the Esmertec JBed JVM, which is not perfect but we are stuck with it for now. Recently we have been getting complaints from customers about OutOfMemoryErrors. After a lot of playing around with things I discovered th...