Java VM, Operating Systems and system resources

I’m just wondering how much does the OS effect Java’s performance?

Since Java isn’t technically embedded into your OS, it makes me wonder how badly does Java fight with Windows and other M$ products over resources.

Currently it’s reasonably well integrated but there are 3 big issues, all related to memory:

  1. Overall footprint. This is partially solved on the new 5.0 client VM, but not the server VM, nor any previous versions, by sharing a mapped internal class file which saves a few megs for every concurrent JVM invocation. It could probably be better; several times in the past people have mooted running a JVM as a “software coprocessor” in a Windows service, executing bytecodes on demand. A path fraught with hassles.

  2. Garbage collection and virtual memory are a surprisingly poor mix. Currently I don’t think the VM takes into account whether any RAM it’s trying to garbage collect is actually in physical RAM or not. This means an allocation for a 4 byte object can trigger a garbage collection and that can trigger a full sweep of all that swapped out RAM. The JVM really needs a pair of switches that forces a chunk of its heap into physical RAM and the garbage collector ergonomics could use this fact to tune up.

  3. Some fool has buggered up the memory allocation code on Java 5.0 to cause really bad high priority stuttering which jerks the entire machine, mouse pointer included.

mouse pointer included

Well, actually… that can’t happen if you use a ps/2 mouse. Plugged into ps/2 the mouse has it’s own interrupt, which ensures that it gets as many cpu cycles as its needs. Whereas usb is a pretty soft thingy, which can be pushed aside by high priority processes.

Except that the JVM should be running in a perfectly ordinary priority, way below the mouse.

Cas :slight_smile:

Yea, that’s true. However, I hadn’t noticed anything like that and my machine is like… y’know… ancient. (My mouse is plugged into usb, because I was to lazy to put it back after I had two mice plugged in for a while.)

But I do for example get an usb-lagged cursor if I start several programs simultaneously.

edit: My os is still win98se. Most likely that’s the reason.

How would Java be effected on Longhorn?
I’ve read all sorts of things about Longhorn and how Java would be slower under Longhorn vs XP.

Well, duh… everything will be slower under longhorn. Simply because the OS wastes even more resources. You will need (again) a way more powerfull rig for offsetting that effect.

For example 2k/xp are slower than 9x if you don’t have more than 512mb ram. It’s faster if you have more ram, because 9x can’t manage more than that.

In specific to Java and Longhorn, it’s about running a VM in another VM.

[quote]Yea, that’s true. However, I hadn’t noticed anything like that and my machine is like… y’know… ancient. (My mouse is plugged into usb, because I was to lazy to put it back after I had two mice plugged in for a while.)
But I do for example get an usb-lagged cursor if I start several programs simultaneously.
edit: My os is still win98se. Most likely that’s the reason.
[/quote]
I have XP SP2 on my computer with USB mouse from Logitech. It’s working. If I can see a lags then just in ms range, or when some window application has a priority request from system. I have thread sheduling setuped as an equal, so background task aren’t discriminated.

Cas try to install Linux as a multi boot so you can test your computer more. It might be interesting to see its behaviour.