Skip to main content

Posts

Showing posts with the label jvm

How to tune Tomcat 5.5 JVM Memory settings without using the configuration program

I need to configure Tomcat memory settings as part of a larger installation, so manually configuring tomcat with the configuration app after the fact is out of the question. I thought I could just throw the JVM memory settings into the JAVA_OPTS environment variable, but I'm testing that with jconsole to see if it works and it... doesn't.

Why reading a volatile and writing to a field member is not scalable in Java?

Observe the following program written in Java (complete runnable version follows, but the important part of the program is in the snippet a little bit further below): import java.util.ArrayList; /** A not easy to explain benchmark. */ class MultiVolatileJavaExperiment { public static void main(String[] args) { (new MultiVolatileJavaExperiment()).mainMethod(args); } int size = Integer.parseInt(System.getProperty("size")); int par = Integer.parseInt(System.getProperty("par")); public void mainMethod(String[] args) { int times = 0; if (args.length == 0) times = 1; else times = Integer.parseInt(args[0]); ArrayList < Long > measurements = new ArrayList < Long > (); for (int i = 0; i < times; i++) { long start = System.currentTimeMillis(); run(); long end = System.currentTimeMillis(); long time = (end - start); System.out.printl

Why doesn"t Sun do a C# to Java byte code compiler?

We Want to Run Our C# Code on the JVM My company has a large C# code base. Well over half of this code is our core engine for creating, reading, modifying, calculating and writing Excel workbooks. We frequently get questions from customers and potential customers asking whether we are going to build a Java version of our engine - many of them are not at all interested in the UI. We even have a few customers who have taken the trouble to use our .NET library from their Java applications. So, we would like to build a Java version of our core engine, ideally without maintaining a separate Java source code base. Eric Sink described this problem very well. I am in a similar position except for the fact that our software license includes royalty free deployment, making Eric's choice of Mainsoft a nonstarter for us. I have been Googling the likes of "c# to jvm" every few months for several years now with no joy. Having spent ~7 years developing similar software for J