Java Tales from a Trading Desk
Noise from an Investment Bank
Thursday, November 25, 2004
Friday, November 19, 2004
String.intern()
The current project I'm currently work on doesn't currently make use of String.intern() - which is probably not that surprising since part of the codebase dates back from 1998. Genady has a good overview of the inner workings of intern(). Assuming you agree to the license over at the Sun Community Source License Download, you can download the appropriate JDK source code and look at the VM implementation. I have to admit I found the source very interesting, especially how the C++ classes have changed from JDK 1.3.1 to 5.0. One thing that surprised me was that intern() is a native method, I'd expected intern() to be implemented in Java and use a HashMap or similar. It's a shame that Sun's JavaDocs don't identify which methods are native.
Sun's memory allocator article made me wonder if the Java VM uses a special malloc for multi-processor machines. The JDK 5.0 appears to perform memory allocations via a macro that wraps os:malloc. Does anyone have any information on this?
Wednesday, November 17, 2004
HotSpot Source Code
It's nice to see that the Java Research License (JRL) source download includes the source code to the HotSpot Client and Server VM's. Assuming the JRL HotSpot is identical to J2SE 5.0, it's a cool download for the developer who wants to know what the VM is doing, and how its doing it. It's a shame Microsoft's Shared Source Common Language Infrastructure (SSCLI) doesn't follow Sun's openness - maybe the up and coming Rotor release will fix this
As blogged elsewhere on the web, its nice to see JDK 6.0 snapshots are available.