Monday, September 26, 2011

Java, GC - object layout thoughts

Just some very draft thoughts - would it be possible to approach some of well-known GC-related memory problems by simply separating structure and data? What I mean is navigational links of an object, i.e. references to other objects, can be kept aside of the flat data associated with the object. In that case structural part of all objects will constitute a smaller memory region compared to the one created by how it is done currently. This may probably improve the efficiency of GC since the collector would need to scan smaller memory spaces with closer reference locality.
The data region would likely need lighter collection algorithms than it currently does. However, a certain side-effect of the approach is that the run-time would have to do an extra navigation every time when a reference has to be resolved into the corresponding data.
UPD 2012-07-16 Here is another experimentally-proven approach which relies on separating of pointer and data values at a finer grain. The key idea is again in that the pointer-data separation allows for building very efficient garbage collection algorithms.

Wednesday, April 27, 2011

Win7 Calc is cool!

Having recently upgraded Vista to Win7 I didn't notice firstly that Calc.exe has been renovated significantly. Now there are four different calculator types - Standard, Scientific, Programmer, and Statistics. Plus there are new panels for unit conversion and date calculations.

Monday, April 18, 2011

Follow-up: Why I consider these features missing in Java

Some time ago I created a list of features I consider missing in the current Java implementation. As I recently realized it makes sense to provide reasoning for some of them to be in the list.

Friday, March 18, 2011

Eclipse CDT crashes on jdk1.6.0_23/24

Just came across a known bug with the latest JVM releases 1.6.0_23 or 24 - Eclipse CDT crashes on start-up. Solution is to add -XX:-UseCompressedOops in the eclipse.ini file.
Oracle tracks the problem in this record. According to it a fix will be delivered with 1.6.0_25.

Sunday, February 27, 2011

Oracle: PL/SQL vs Java - one unconventional question

All the time since the introduction of Java engine within Oracle RDBMS people have been wondering how performance of Java stored procedures compare to orthodox ones written in PL/SQL. There are lots of performance tests demonstrating where things stand. Surprise! I am not going to discuss it here. What I am really curious about is what we may expect in future. Might it happen that one day PL/SQL will be fully replaced with the Java engine?

Wednesday, February 9, 2011

jvisualvm from jdk1.6.0_22 crashes on my Vista x64

Just discovered that jvisualvm.exe from jdk1.6.0_22 crashes with no apparent reason while starting up on my Vista x64 laptop. This is quite weird as yesterday I managed to start it many times without a problem, although there were two or three crashes. Not sure what has happened. Assuming that some of plug-ins may be corrupt I tried to remove the configuration under Application Data\.visualvm\6u20 folder. It started well a few times then again rejected to start. The same utility from jdk1.6.0_16 seems to operate well.
I am going to upgrade to jdk1.6.0_23 and see whether it solves the problem.

UPD Seems it is more stable in jdk1.6.0_23.
UPD #2 Here VisualVM dev team mention a Java bug that affects 64bit systems and they suggest adding "-J-Dsun.java2d.d3d=false" to the command line as a solution.
UPD #3 In JDK1.6.0_23 this option is already provided by default in ${JDK_HOME}\lib\visualvm\etc\visualvm.conf.

Friday, February 4, 2011

Why no ClassShutter in Java6 JS engine?

There is one thing about Java6 I am in a way baffled by. As far as I remember the JavaScript scripting engine in Java6 has been based on Mozilla Rhino. How did it happen that the implementation in Java6 is missing the original Rhino functionality for restricting the set of classes that may be loaded by a script?

I assume the feature has been replaced by allowing a custom implementation of java.lang.ClassLoader in one of javax.script.ScriptEngineManager constructors. This offers unlimited flexibility for other scripting engines that might be plugged in the JVM instance. Then another question - is there any built-in ClassLoader in Java6 that supports class filtering? Because of safety reasons it is quite natural to limit the set of classes loadable by scripting extensions. However it seems there is no standard or default way to do that. So everybody willing to ensure better control over the extension scripts has to build their own implementation of essentially the same functionality. Not quite encouraging.